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;
}
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);
}
}
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;
}
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();
}
});
}
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;
}
Aggregations