use of org.eclipse.ui.forms.events.IHyperlinkListener in project tmdm-studio-se by Talend.
the class StoredProcedureMainPage method createCharacteristicsContent.
@Override
protected void createCharacteristicsContent(FormToolkit toolkit, Composite charComposite) {
try {
WSStoredProcedure wsStoredProcedure = (WSStoredProcedure) (getXObject().getWsObject());
// description
Label descriptionLabel = toolkit.createLabel(charComposite, Messages.StoredProcedureMainPage_4, SWT.NULL);
descriptionLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false, 1, 1));
// $NON-NLS-1$
descriptionText = toolkit.createText(charComposite, "", SWT.BORDER);
descriptionText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
// $NON-NLS-1$
descriptionText.setText(wsStoredProcedure.getDescription() == null ? "" : wsStoredProcedure.getDescription());
descriptionText.addModifyListener(this);
// Procedure
Group storedProcedureGroup = new Group(charComposite, SWT.SHADOW_NONE);
storedProcedureGroup.setText(Messages.StoredProcedureMainPage_5);
storedProcedureGroup.setLayout(new GridLayout(1, true));
storedProcedureGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
((GridData) storedProcedureGroup.getLayoutData()).minimumHeight = 100;
procedureViewer = new SourceViewer(storedProcedureGroup, new VerticalRuler(10), SWT.V_SCROLL);
procedureViewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
procedureViewer.addTextListener(this);
WidgetUtils.initRedoUndo(procedureViewer);
refreshCacheBtn = toolkit.createButton(charComposite, Messages.StoredProcedureMainPage_6, SWT.CHECK);
refreshCacheBtn.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
refreshCacheBtn.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
markDirty();
}
public void widgetDefaultSelected(SelectionEvent e) {
markDirty();
}
});
/**
**********************************************************
* Execute Stored Procedure
***********************************************************
*/
createCompDropTarget();
Composite resultsGroup = this.getNewSectionComposite(Messages.StoredProcedureMainPage_7);
resultsGroup.setLayout(new GridLayout(4, false));
// data cluster
Hyperlink dataClusterLink = toolkit.createHyperlink(resultsGroup, Messages.StoredProcedureMainPage_8, SWT.NULL);
dataClusterLink.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, true, 1, 1));
dataClusterLink.addHyperlinkListener(new IHyperlinkListener() {
public void linkEntered(org.eclipse.ui.forms.events.HyperlinkEvent e) {
}
public void linkExited(org.eclipse.ui.forms.events.HyperlinkEvent e) {
}
public void linkActivated(org.eclipse.ui.forms.events.HyperlinkEvent e) {
if (!isLocalInput()) {
TreeParent serverRoot = StoredProcedureMainPage.this.getXObject().getServerRoot();
TreeObject iaObject = new TreeObject(StoredProcedureMainPage.this.dataClusterCombo.getText(), serverRoot, TreeObject.DATA_CLUSTER, new WSDataClusterPK(StoredProcedureMainPage.this.dataClusterCombo.getText()), null);
(new EditXObjectAction(iaObject, StoredProcedureMainPage.this.getSite().getPage())).run();
}
}
});
dataClusterCombo = new Combo(resultsGroup, SWT.READ_ONLY | SWT.DROP_DOWN | SWT.SINGLE);
dataClusterCombo.setLayoutData(new GridData(SWT.BEGINNING, SWT.NONE, false, false, 1, 1));
Button executeButton = new Button(resultsGroup, SWT.PUSH);
executeButton.setText(Messages.StoredProcedureMainPage_9);
executeButton.addMouseListener(new MouseListener() {
public void mouseUp(MouseEvent e) {
executeProcedure();
}
public void mouseDoubleClick(MouseEvent e) {
}
public void mouseDown(MouseEvent e) {
}
});
resultsLabel = toolkit.createLabel(resultsGroup, // $NON-NLS-1$
" ", SWT.NULL);
resultsLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, true, false, 1, 1));
resultsViewer = new TableViewer(resultsGroup);
resultsViewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 4, 1));
((GridData) resultsViewer.getControl().getLayoutData()).heightHint = 300;
resultsViewer.setContentProvider(new ArrayContentProvider());
resultsViewer.setLabelProvider(new XMLTableLabelProvider());
resultsViewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
resultsViewer.setSelection(event.getSelection());
new ResultsViewAction(StoredProcedureMainPage.this.getSite().getShell(), resultsViewer).run();
}
});
hookContextMenu();
refreshData();
dataClusterCombo.select(0);
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
use of org.eclipse.ui.forms.events.IHyperlinkListener in project liferay-ide by liferay.
the class ImportGlobalSettingsNotificationSink method showPopup.
@Override
public void showPopup() {
if (popup != null) {
popup.close();
}
Shell shell = new Shell(PlatformUI.getWorkbench().getDisplay());
popup = new NotificationPopup(shell) {
@Override
protected void createContentArea(Composite parent) {
super.createContentArea(parent);
hookHyperlink(parent);
}
@Override
protected String getPopupShellTitle() {
return "Liferay IDE Notification";
}
private void hookHyperlink(Composite parent) {
Hyperlink hyperlink = null;
for (Control child : parent.getChildren()) {
if (child instanceof Hyperlink) {
hyperlink = (Hyperlink) child;
hyperlink.addHyperlinkListener(new IHyperlinkListener() {
public void linkExited(HyperlinkEvent e) {
}
public void linkEntered(HyperlinkEvent e) {
}
public void linkActivated(HyperlinkEvent e) {
if (popup != null) {
popup.closeFade();
}
}
});
return;
} else if (child instanceof Composite) {
hookHyperlink((Composite) child);
}
}
}
};
popup.setFadingEnabled(isAnimationsEnabled());
List<AbstractNotification> toDisplay = new ArrayList<AbstractNotification>(getNotifications());
Collections.sort(toDisplay);
popup.setContents(toDisplay);
getNotifications().clear();
popup.setBlockOnOpen(false);
popup.setDelayClose(60 * 1000);
popup.open();
}
use of org.eclipse.ui.forms.events.IHyperlinkListener in project jbosstools-hibernate by jbosstools.
the class RevEngOverviewPage method createClient.
private FormText createClient(Composite section, String content, FormToolkit toolkit) {
FormText text = toolkit.createFormText(section, true);
try {
text.setText(content, true, false);
} catch (SWTException e) {
text.setText(e.getMessage(), false, false);
}
section.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
text.addHyperlinkListener(new IHyperlinkListener() {
public void linkEntered(HyperlinkEvent e) {
}
public void linkExited(HyperlinkEvent e) {
}
public void linkActivated(HyperlinkEvent e) {
String href = (String) e.getHref();
getEditor().setActivePage(href);
}
});
return text;
}
Aggregations