Search in sources :

Example 1 with HyperlinkEvent

use of org.eclipse.ui.forms.events.HyperlinkEvent in project tdi-studio-se by Talend.

the class RuntimeGraphcsComposite method createMessagePage.

private Composite createMessagePage(Composite parent) {
    messagePage = new Composite(parent, SWT.NONE);
    FormLayout messageLayout = new FormLayout();
    messageLayout.marginHeight = 0;
    messageLayout.marginWidth = 0;
    messagePage.setLayout(messageLayout);
    messagePage.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
    FormToolkit toolkit = new FormToolkit(Display.getDefault());
    Hyperlink hyperlink = toolkit.createHyperlink(messagePage, Messages.loadDefaultChartSetLabel, SWT.NONE);
    hyperlink.addHyperlinkListener(new HyperlinkAdapter() {

        @Override
        public void linkActivated(HyperlinkEvent event) {
            try {
                new LoadChartAction(RuntimeGraphcsComposite.this).loadDefaultChartSet();
            } catch (JvmCoreException e) {
                Activator.log(Messages.loadChartSetFailedMsg, e);
            }
        }
    });
    return messagePage;
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) HyperlinkEvent(org.eclipse.ui.forms.events.HyperlinkEvent) Composite(org.eclipse.swt.widgets.Composite) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) FormToolkit(org.eclipse.ui.forms.widgets.FormToolkit) LoadChartAction(org.talend.designer.runtime.visualization.internal.ui.properties.timeline.LoadChartAction) Hyperlink(org.eclipse.ui.forms.widgets.Hyperlink) HyperlinkAdapter(org.eclipse.ui.forms.events.HyperlinkAdapter) JvmCoreException(org.talend.designer.runtime.visualization.JvmCoreException)

Example 2 with HyperlinkEvent

use of org.eclipse.ui.forms.events.HyperlinkEvent in project tdi-studio-se by Talend.

the class TimelineSection method createMessagePage.

/**
     * Creates the message page.
     * 
     * @return The message page
     */
private Composite createMessagePage() {
    messagePage = new Composite(timelinePageBook, SWT.NONE);
    messagePage.setLayout(new GridLayout(3, false));
    messagePage.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
    FormToolkit toolkit = new FormToolkit(Display.getDefault());
    Hyperlink hyperlink = toolkit.createHyperlink(messagePage, Messages.loadDefaultChartSetLabel, SWT.NONE);
    hyperlink.addHyperlinkListener(new HyperlinkAdapter() {

        @Override
        public void linkActivated(HyperlinkEvent event) {
            try {
                new LoadChartSetAction(TimelineSection.this).loadDefaultChartSet();
            } catch (JvmCoreException e) {
                Activator.log(Messages.loadChartSetFailedMsg, e);
            }
        }
    });
    return messagePage;
}
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) FormToolkit(org.eclipse.ui.forms.widgets.FormToolkit) Hyperlink(org.eclipse.ui.forms.widgets.Hyperlink) HyperlinkAdapter(org.eclipse.ui.forms.events.HyperlinkAdapter) JvmCoreException(org.talend.designer.runtime.visualization.JvmCoreException)

Example 3 with HyperlinkEvent

use of org.eclipse.ui.forms.events.HyperlinkEvent in project tdi-studio-se by Talend.

the class AbstractTabPage method createMessageLabel.

/**
     * Creates the message label.
     */
private void createMessageLabel() {
    messagePage = new Composite(this, SWT.NONE);
    messagePage.setLayout(new GridLayout(3, false));
    messagePage.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
    FormToolkit toolkit = new FormToolkit(Display.getDefault());
    toolkit.createLabel(messagePage, Messages.patckagesNotSpecifiedMsg);
    Hyperlink hyperlink = toolkit.createHyperlink(messagePage, Messages.selectPackagesMsg, SWT.NONE);
    hyperlink.addHyperlinkListener(new HyperlinkAdapter() {

        @Override
        public void linkActivated(HyperlinkEvent e) {
            new ConfigureCpuProfilerAction(cpuSection).run();
        }
    });
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) HyperlinkEvent(org.eclipse.ui.forms.events.HyperlinkEvent) Composite(org.eclipse.swt.widgets.Composite) FormToolkit(org.eclipse.ui.forms.widgets.FormToolkit) ConfigureCpuProfilerAction(org.talend.designer.runtime.visualization.internal.ui.properties.cpu.actions.ConfigureCpuProfilerAction) Hyperlink(org.eclipse.ui.forms.widgets.Hyperlink) HyperlinkAdapter(org.eclipse.ui.forms.events.HyperlinkAdapter)

Example 4 with HyperlinkEvent

use of org.eclipse.ui.forms.events.HyperlinkEvent in project tdi-studio-se by Talend.

the class AbstractJvmPropertySection method createMessagePage.

/**
     * Creates the message page.
     * 
     * @param parent The parent composite
     * @return The message page
     */
private Composite createMessagePage(Composite parent) {
    Composite composite = new Composite(parent, SWT.NONE);
    composite.setLayout(new GridLayout(1, false));
    messageLabel = new Label(composite, SWT.NONE);
    messageLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    FormToolkit toolkit = new FormToolkit(Display.getDefault());
    toolkit.setBackground(composite.getBackground());
    faqHyperlink = toolkit.createHyperlink(composite, Messages.seeFaqMsg, SWT.NONE);
    faqHyperlink.addHyperlinkListener(new HyperlinkAdapter() {

        @Override
        public void linkActivated(HyperlinkEvent e) {
            PlatformUI.getWorkbench().getHelpSystem().displayHelpResource(FAQ_URL);
        }
    });
    return composite;
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) HyperlinkEvent(org.eclipse.ui.forms.events.HyperlinkEvent) Composite(org.eclipse.swt.widgets.Composite) FormToolkit(org.eclipse.ui.forms.widgets.FormToolkit) Label(org.eclipse.swt.widgets.Label) GridData(org.eclipse.swt.layout.GridData) HyperlinkAdapter(org.eclipse.ui.forms.events.HyperlinkAdapter)

Example 5 with HyperlinkEvent

use of org.eclipse.ui.forms.events.HyperlinkEvent in project bndtools by bndtools.

the class BuildOperationsPart method createClient.

/**
     * Fill the section.
     */
private void createClient(Section section, FormToolkit toolkit) {
    section.setText("Build Operations");
    Composite container = toolkit.createComposite(section);
    section.setClient(container);
    container.setLayout(new GridLayout(1, false));
    ImageHyperlink lnkRebuildProject = toolkit.createImageHyperlink(container, SWT.NONE);
    lnkRebuildProject.addHyperlinkListener(new HyperlinkAdapter() {

        @Override
        public void linkActivated(HyperlinkEvent e) {
            IResource resource = findEditorResource();
            if (resource != null) {
                RebuildJob job = new RebuildJob(resource.getProject(), IncrementalProjectBuilder.FULL_BUILD);
                job.setUser(true);
                job.schedule();
            }
        }
    });
    toolkit.paintBordersFor(lnkRebuildProject);
    lnkRebuildProject.setText("Rebuild Project");
    lnkRebuildProject.setImage(refreshImg);
    ImageHyperlink lnkCleanProject = toolkit.createImageHyperlink(container, SWT.NONE);
    toolkit.paintBordersFor(lnkCleanProject);
    lnkCleanProject.setText("Clean Project");
    lnkCleanProject.setImage(cleanImg);
    lnkCleanProject.addHyperlinkListener(new HyperlinkAdapter() {

        @Override
        public void linkActivated(HyperlinkEvent e) {
            IResource resource = findEditorResource();
            if (resource != null) {
                RebuildJob job = new RebuildJob(resource.getProject(), IncrementalProjectBuilder.CLEAN_BUILD);
                job.setUser(true);
                job.schedule();
            }
        }
    });
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) HyperlinkEvent(org.eclipse.ui.forms.events.HyperlinkEvent) Composite(org.eclipse.swt.widgets.Composite) ImageHyperlink(org.eclipse.ui.forms.widgets.ImageHyperlink) IResource(org.eclipse.core.resources.IResource) HyperlinkAdapter(org.eclipse.ui.forms.events.HyperlinkAdapter)

Aggregations

HyperlinkEvent (org.eclipse.ui.forms.events.HyperlinkEvent)14 Composite (org.eclipse.swt.widgets.Composite)13 GridLayout (org.eclipse.swt.layout.GridLayout)12 HyperlinkAdapter (org.eclipse.ui.forms.events.HyperlinkAdapter)12 Hyperlink (org.eclipse.ui.forms.widgets.Hyperlink)8 GridData (org.eclipse.swt.layout.GridData)7 FormToolkit (org.eclipse.ui.forms.widgets.FormToolkit)6 Label (org.eclipse.swt.widgets.Label)5 URL (java.net.URL)4 PartInitException (org.eclipse.ui.PartInitException)4 IStatus (org.eclipse.core.runtime.IStatus)3 Status (org.eclipse.core.runtime.Status)3 IWorkbenchBrowserSupport (org.eclipse.ui.browser.IWorkbenchBrowserSupport)3 FormText (org.eclipse.ui.forms.widgets.FormText)3 JpmPreferences (bndtools.preferences.JpmPreferences)2 IOException (java.io.IOException)2 MalformedURLException (java.net.MalformedURLException)2 IResource (org.eclipse.core.resources.IResource)2 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)2 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)2