Search in sources :

Example 6 with FormToolkit

use of org.eclipse.ui.forms.widgets.FormToolkit 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 7 with FormToolkit

use of org.eclipse.ui.forms.widgets.FormToolkit in project tdi-studio-se by Talend.

the class RuntimeGraphcsComposite method createSection.

private void createSection(Composite parent, IMonitoredMXBeanGroup group) {
    if (parent.isDisposed()) {
        return;
    }
    FormToolkit tookit = new FormToolkit(Display.getDefault());
    ExpandableComposite section = tookit.createSection(parent, ExpandableComposite.NO_TITLE);
    section.setText(group.getName());
    FormLayout sectionLayout = new FormLayout();
    sectionLayout.marginWidth = 0;
    sectionLayout.marginHeight = 0;
    section.setLayout(sectionLayout);
    FormData sectionData = new FormData();
    if (group.getName().equals(MonitorAttributeName.HEAP_MEMORY)) {
        sectionData.left = new FormAttachment(0, 0);
        sectionData.right = new FormAttachment(65, 0);
        sectionData.top = new FormAttachment(0, 6);
        sectionData.bottom = new FormAttachment(53, -5);
    } else if (group.getName().equals(MonitorAttributeName.THREAD_COUNT)) {
        sectionData.left = new FormAttachment(50, 5);
        sectionData.right = new FormAttachment(100, -5);
        sectionData.top = new FormAttachment(50, 2);
        sectionData.bottom = new FormAttachment(100, 0);
    } else if (group.getName().equals(MonitorAttributeName.CPU_USE)) {
        sectionData.left = new FormAttachment(0, 0);
        sectionData.right = new FormAttachment(65, 0);
        sectionData.top = new FormAttachment(53, 0);
        sectionData.bottom = new FormAttachment(100, -6);
    }
    section.setLayoutData(sectionData);
    Composite flatFormComposite = createFlatFormComposite(section, tookit);
    FormLayout formLayout = new FormLayout();
    formLayout.marginHeight = 0;
    formLayout.marginWidth = 0;
    flatFormComposite.setLayout(formLayout);
    TimelineChart chart = new TimelineChart(flatFormComposite, section, group, SWT.NONE, toString() + getJvm().getPid());
    charts.add(chart);
    FormData data;
    data = new FormData();
    data.left = new FormAttachment(0, 0);
    data.right = new FormAttachment(100, 0);
    data.top = new FormAttachment(0, 0);
    data.bottom = new FormAttachment(100, 0);
    chart.setLayoutData(data);
    section.setClient(flatFormComposite);
    ArrayList<Action> list = new ArrayList<Action>();
    list.add(garbageCollectorAction);
    if (group.getName().equals(MonitorAttributeName.HEAP_MEMORY)) {
        addSectionActions(section, list);
    }
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) LoadChartAction(org.talend.designer.runtime.visualization.internal.ui.properties.timeline.LoadChartAction) GarbageAction(org.talend.designer.runtime.visualization.internal.ui.properties.memory.GarbageAction) Action(org.eclipse.jface.action.Action) FormToolkit(org.eclipse.ui.forms.widgets.FormToolkit) Composite(org.eclipse.swt.widgets.Composite) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) ArrayList(java.util.ArrayList) TimelineChart(org.talend.designer.runtime.visualization.internal.ui.properties.timeline.TimelineChart) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) FormAttachment(org.eclipse.swt.layout.FormAttachment)

Example 8 with FormToolkit

use of org.eclipse.ui.forms.widgets.FormToolkit 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 9 with FormToolkit

use of org.eclipse.ui.forms.widgets.FormToolkit 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 10 with FormToolkit

use of org.eclipse.ui.forms.widgets.FormToolkit 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)

Aggregations

FormToolkit (org.eclipse.ui.forms.widgets.FormToolkit)32 Composite (org.eclipse.swt.widgets.Composite)28 GridLayout (org.eclipse.swt.layout.GridLayout)27 GridData (org.eclipse.swt.layout.GridData)23 Button (org.eclipse.swt.widgets.Button)11 Label (org.eclipse.swt.widgets.Label)11 Text (org.eclipse.swt.widgets.Text)9 FillLayout (org.eclipse.swt.layout.FillLayout)7 ManagedForm (org.eclipse.ui.forms.ManagedForm)7 ExpandableComposite (org.eclipse.ui.forms.widgets.ExpandableComposite)7 ScrolledForm (org.eclipse.ui.forms.widgets.ScrolledForm)7 MessageHyperlinkAdapter (bndtools.utils.MessageHyperlinkAdapter)6 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)6 SelectionEvent (org.eclipse.swt.events.SelectionEvent)6 MDSashForm (bndtools.editor.common.MDSashForm)5 HyperlinkAdapter (org.eclipse.ui.forms.events.HyperlinkAdapter)5 HyperlinkEvent (org.eclipse.ui.forms.events.HyperlinkEvent)5 Combo (org.eclipse.swt.widgets.Combo)4 FormLayout (org.eclipse.swt.layout.FormLayout)3 Hyperlink (org.eclipse.ui.forms.widgets.Hyperlink)3