use of org.eclipse.ui.forms.widgets.ImageHyperlink in project tdq-studio-se by Talend.
the class ColumnAnalysisDetailsPage method createAnalysisColumnsSection.
void createAnalysisColumnsSection(final ScrolledForm form1, Composite anasisDataComp) {
analysisColumnSection = createSection(form1, anasisDataComp, DefaultMessagesImpl.getString("ColumnMasterDetailsPage.analyzeColumn"), // $NON-NLS-1$
null);
Composite topComp1 = toolkit.createComposite(analysisColumnSection, SWT.NONE);
topComp1.setLayout(new GridLayout());
Composite actionBarComp = toolkit.createComposite(topComp1, SWT.NONE);
GridLayout gdLayout = new GridLayout();
gdLayout.numColumns = 5;
gdLayout.horizontalSpacing = 20;
GridData data = new GridData();
data.horizontalAlignment = GridData.FILL;
data.grabExcessHorizontalSpace = true;
actionBarComp.setLayoutData(data);
actionBarComp.setLayout(gdLayout);
ImageHyperlink collapseAllImageLink = toolkit.createImageHyperlink(actionBarComp, SWT.NONE);
// $NON-NLS-1$
collapseAllImageLink.setToolTipText(DefaultMessagesImpl.getString("CollapseAllColumns"));
WorkbenchUtils.setHyperlinkImage(collapseAllImageLink, ImageLib.getImage(ImageLib.COLLAPSE_ALL));
collapseAllImageLink.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
TreeItem[] items = treeViewer.getTree().getItems();
expandTreeItems(items, false);
packOtherColumns();
}
});
ImageHyperlink expandAllImageLink = toolkit.createImageHyperlink(actionBarComp, SWT.NONE);
// $NON-NLS-1$
expandAllImageLink.setToolTipText(DefaultMessagesImpl.getString("ExpandAllColumns"));
WorkbenchUtils.setHyperlinkImage(expandAllImageLink, ImageLib.getImage(ImageLib.EXPAND_ALL));
expandAllImageLink.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
TreeItem[] items = treeViewer.getTree().getItems();
expandTreeItems(items, true);
packOtherColumns();
}
});
createIndicatorSelectButton(actionBarComp);
createRunButton(actionBarComp);
navigationComposite = toolkit.createComposite(actionBarComp, SWT.NONE);
navigationComposite.setLayoutData(data);
navigationComposite.setLayout(new GridLayout());
createPaginationTree(topComp1);
analysisColumnSection.setClient(topComp1);
}
use of org.eclipse.ui.forms.widgets.ImageHyperlink in project tdq-studio-se by Talend.
the class ColumnAnalysisResultPage method createExpandAllLink.
/**
* create ExpandAll Link for result section.
*
* @param composite
*/
private void createExpandAllLink(Composite composite) {
ImageHyperlink expandAllImageLink = toolkit.createImageHyperlink(composite, SWT.NONE);
// $NON-NLS-1$
expandAllImageLink.setToolTipText(DefaultMessagesImpl.getString("ExpandAllColumns"));
WorkbenchUtils.setHyperlinkImage(expandAllImageLink, ImageLib.getImage(ImageLib.EXPAND_ALL));
expandAllImageLink.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
if (!resultSection.isExpanded()) {
resultSection.setExpanded(true);
}
List<ExpandableComposite> expandableCompositeList = getExpandableCompositeList();
if (expandableCompositeList != null && !expandableCompositeList.isEmpty()) {
for (ExpandableComposite comp : expandableCompositeList) {
comp.setExpanded(true);
comp.getParent().pack();
}
}
form.reflow(true);
}
});
}
use of org.eclipse.ui.forms.widgets.ImageHyperlink in project statecharts by Yakindu.
the class AbstractEditorPropertySection method createHelpWidget.
protected void createHelpWidget(final Composite parent, final Control control, String helpId) {
final ImageHyperlink helpWidget = toolkit.createImageHyperlink(parent, SWT.CENTER);
Image defaultImage = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_LCL_LINKTO_HELP);
helpWidget.setImage(defaultImage);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).applyTo(helpWidget);
helpWidget.setToolTipText(JFaceResources.getString(IDialogLabelKeys.HELP_LABEL_KEY));
helpWidget.addMouseListener(new MouseAdapter() {
public void mouseDown(MouseEvent e) {
control.setFocus();
PlatformUI.getWorkbench().getHelpSystem().displayDynamicHelp();
}
});
GridDataFactory.fillDefaults().applyTo(helpWidget);
helpWidget.setEnabled(true);
setHelpContext(control, helpId);
}
use of org.eclipse.ui.forms.widgets.ImageHyperlink in project ecf by eclipse.
the class NotificationDialog method createContents.
protected Control createContents(Composite parent) {
toolkit = new FormToolkit(parent.getDisplay());
Section section = toolkit.createSection(parent, Section.TITLE_BAR);
section.setLayout(new GridLayout(1, false));
section.setText("Incoming Collaboration Request");
Composite composite = toolkit.createComposite(section);
composite.setLayout(new GridLayout(1, false));
composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
section.setClient(composite);
ImageHyperlink hyperlink = toolkit.createImageHyperlink(composite, SWT.LEAD);
hyperlink.setHoverImage(PlatformUI.getWorkbench().getSharedImages().getImage(IDE.SharedImages.IMG_OBJ_PROJECT));
hyperlink.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(IDE.SharedImages.IMG_OBJ_PROJECT_CLOSED));
hyperlink.setText("Share Project Request");
if (listener != null) {
hyperlink.addHyperlinkListener(listener);
}
hyperlink.addHyperlinkListener(new CloseDialogListener());
Control text = toolkit.createText(composite, sender.getName() + " has sent a request to share project '" + projectName + "' with you.");
text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
return section;
}
use of org.eclipse.ui.forms.widgets.ImageHyperlink in project netxms by netxms.
the class DefaultLoginForm method createContents.
/* (non-Javadoc)
* @see org.eclipse.jface.window.Window#createContents(org.eclipse.swt.widgets.Composite)
*/
@Override
protected Control createContents(Composite parent) {
colors = new ColorCache(parent);
parent.setBackground(colors.create(SCREEN_BACKGROUND));
Composite fillerTop = new Composite(parent, SWT.NONE);
fillerTop.setBackground(colors.create(SCREEN_BACKGROUND));
GridData gd = new GridData();
gd.grabExcessHorizontalSpace = true;
gd.grabExcessVerticalSpace = false;
gd.horizontalAlignment = SWT.FILL;
gd.verticalAlignment = SWT.FILL;
gd.heightHint = 100;
fillerTop.setLayoutData(gd);
// SWT.NO_FOCUS is a workaround for Eclipse/RAP bug 321274
final Canvas content = new Canvas(parent, SWT.NO_FOCUS);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
layout.marginWidth = 10;
layout.marginHeight = 10;
layout.horizontalSpacing = 10;
layout.verticalSpacing = 10;
content.setLayout(layout);
gd = new GridData();
gd.grabExcessHorizontalSpace = true;
gd.grabExcessVerticalSpace = true;
gd.horizontalAlignment = SWT.CENTER;
gd.verticalAlignment = SWT.CENTER;
content.setLayoutData(gd);
content.setBackground(colors.create(FORM_BACKGROUND));
final Image userImage = (properties.getProperty("loginFormImage") != null) ? loadUserImage() : null;
final ImageDescriptor customImage = BrandingManager.getInstance().getLoginTitleImage();
// $NON-NLS-1$
final Image loginImage = (userImage != null) ? userImage : ((customImage != null) ? customImage.createImage() : Activator.getImageDescriptor("icons/login.png").createImage());
Label logo = new Label(content, SWT.NONE);
logo.setBackground(colors.create(FORM_BACKGROUND));
logo.setImage(loginImage);
logo.setLayoutData(new GridData(SWT.CENTER, SWT.TOP, false, false));
Composite loginArea = new Composite(content, SWT.NONE);
loginArea.setBackground(colors.create(FORM_BACKGROUND));
layout = new GridLayout();
loginArea.setLayout(layout);
gd = new GridData();
gd.widthHint = 300;
gd.verticalAlignment = SWT.FILL;
gd.grabExcessVerticalSpace = true;
loginArea.setLayoutData(gd);
textLogin = new LabeledText(loginArea, SWT.NONE);
textLogin.setBackground(colors.create(FORM_BACKGROUND));
textLogin.setLabel(Messages.get().LoginForm_UserName);
textLogin.getTextControl().setData(RWT.CUSTOM_VARIANT, "login");
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
textLogin.setLayoutData(gd);
textPassword = new LabeledText(loginArea, SWT.NONE, SWT.SINGLE | SWT.BORDER | SWT.PASSWORD);
textPassword.setBackground(colors.create(FORM_BACKGROUND));
textPassword.setLabel(Messages.get().LoginForm_Password);
textPassword.getTextControl().setData(RWT.CUSTOM_VARIANT, "login");
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
textPassword.setLayoutData(gd);
Button okButton = new Button(loginArea, SWT.PUSH);
okButton.setText(Messages.get().LoginForm_LoginButton);
okButton.setData(RWT.CUSTOM_VARIANT, "login");
okButton.addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent e) {
okPressed();
}
@Override
public void widgetDefaultSelected(SelectionEvent e) {
widgetSelected(e);
}
});
gd = new GridData();
gd.horizontalAlignment = SWT.LEFT;
gd.widthHint = WidgetHelper.BUTTON_WIDTH_HINT;
gd.verticalIndent = 5;
okButton.setLayoutData(gd);
final ImageHyperlink setupLink = new ImageHyperlink(loginArea, SWT.NONE);
setupLink.setText(Messages.get().LoginForm_Options);
setupLink.setForeground(colors.create(33, 0, 127));
gd = new GridData();
gd.horizontalAlignment = SWT.RIGHT;
gd.verticalAlignment = SWT.BOTTOM;
gd.grabExcessVerticalSpace = true;
setupLink.setLayoutData(gd);
setupLink.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkEntered(HyperlinkEvent e) {
super.linkEntered(e);
setupLink.setUnderlined(true);
}
@Override
public void linkExited(HyperlinkEvent e) {
super.linkExited(e);
setupLink.setUnderlined(false);
}
@Override
public void linkActivated(HyperlinkEvent e) {
if (advancedSettingsEnabled) {
LoginSettingsDialog dlg = new LoginSettingsDialog(getShell(), properties);
dlg.open();
} else {
MessageDialog.openError(getShell(), Messages.get().LoginForm_Error, Messages.get().LoginForm_AdvOptionsDisabled);
}
}
});
content.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent event) {
loginImage.dispose();
}
});
Composite fillerBottom = new Composite(parent, SWT.NONE);
fillerBottom.setBackground(colors.create(SCREEN_BACKGROUND));
fillerBottom.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
Label version = new Label(parent, SWT.NONE);
version.setText(String.format(Messages.get().LoginForm_Version, NXCommon.VERSION + " (" + BuildNumber.TEXT + ")"));
version.setBackground(parent.getBackground());
version.setForeground(colors.create(VERSION_FOREGROUND));
gd = new GridData();
gd.horizontalAlignment = SWT.RIGHT;
gd.verticalAlignment = SWT.BOTTOM;
version.setLayoutData(gd);
getShell().setDefaultButton(okButton);
textLogin.getTextControl().setFocus();
return content;
}
Aggregations