Search in sources :

Example 6 with ImageHyperlink

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);
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) HyperlinkEvent(org.eclipse.ui.forms.events.HyperlinkEvent) Composite(org.eclipse.swt.widgets.Composite) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) ImageHyperlink(org.eclipse.ui.forms.widgets.ImageHyperlink) GridData(org.eclipse.swt.layout.GridData) HyperlinkAdapter(org.eclipse.ui.forms.events.HyperlinkAdapter)

Example 7 with ImageHyperlink

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);
        }
    });
}
Also used : HyperlinkEvent(org.eclipse.ui.forms.events.HyperlinkEvent) ImageHyperlink(org.eclipse.ui.forms.widgets.ImageHyperlink) ArrayList(java.util.ArrayList) List(java.util.List) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) HyperlinkAdapter(org.eclipse.ui.forms.events.HyperlinkAdapter)

Example 8 with ImageHyperlink

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);
}
Also used : MouseEvent(org.eclipse.swt.events.MouseEvent) ImageHyperlink(org.eclipse.ui.forms.widgets.ImageHyperlink) MouseAdapter(org.eclipse.swt.events.MouseAdapter) Image(org.eclipse.swt.graphics.Image)

Example 9 with ImageHyperlink

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;
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Control(org.eclipse.swt.widgets.Control) FormToolkit(org.eclipse.ui.forms.widgets.FormToolkit) Composite(org.eclipse.swt.widgets.Composite) ImageHyperlink(org.eclipse.ui.forms.widgets.ImageHyperlink) GridData(org.eclipse.swt.layout.GridData) Section(org.eclipse.ui.forms.widgets.Section)

Example 10 with ImageHyperlink

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;
}
Also used : DisposeListener(org.eclipse.swt.events.DisposeListener) ColorCache(org.netxms.ui.eclipse.tools.ColorCache) HyperlinkEvent(org.eclipse.ui.forms.events.HyperlinkEvent) Composite(org.eclipse.swt.widgets.Composite) ImageHyperlink(org.eclipse.ui.forms.widgets.ImageHyperlink) LabeledText(org.netxms.ui.eclipse.widgets.LabeledText) Canvas(org.eclipse.swt.widgets.Canvas) Label(org.eclipse.swt.widgets.Label) Image(org.eclipse.swt.graphics.Image) DisposeEvent(org.eclipse.swt.events.DisposeEvent) GridLayout(org.eclipse.swt.layout.GridLayout) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor) SelectionListener(org.eclipse.swt.events.SelectionListener) HyperlinkAdapter(org.eclipse.ui.forms.events.HyperlinkAdapter)

Aggregations

ImageHyperlink (org.eclipse.ui.forms.widgets.ImageHyperlink)50 HyperlinkEvent (org.eclipse.ui.forms.events.HyperlinkEvent)46 HyperlinkAdapter (org.eclipse.ui.forms.events.HyperlinkAdapter)45 GridLayout (org.eclipse.swt.layout.GridLayout)37 Composite (org.eclipse.swt.widgets.Composite)35 GridData (org.eclipse.swt.layout.GridData)34 ArrayContentProvider (org.eclipse.jface.viewers.ArrayContentProvider)19 TableViewer (org.eclipse.jface.viewers.TableViewer)17 Section (org.eclipse.ui.forms.widgets.Section)16 TableWrapData (org.eclipse.ui.forms.widgets.TableWrapData)16 ExpandableComposite (org.eclipse.ui.forms.widgets.ExpandableComposite)8 CLabel (org.eclipse.swt.custom.CLabel)7 List (java.util.List)5 Image (org.eclipse.swt.graphics.Image)5 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)4 Control (org.eclipse.swt.widgets.Control)4 Label (org.eclipse.swt.widgets.Label)4 ArrayList (java.util.ArrayList)3 ILabelProvider (org.eclipse.jface.viewers.ILabelProvider)3 DisposeEvent (org.eclipse.swt.events.DisposeEvent)3