use of org.eclipse.ui.forms.widgets.ExpandableComposite in project tdi-studio-se by Talend.
the class InfoPage method createSnapshotSection.
/**
* Creates the snapshot section.
*
* @param parent The parent composite
* @param toolkit The toolkit
*/
private void createSnapshotSection(Composite parent, FormToolkit toolkit) {
ExpandableComposite section = toolkit.createSection(parent, ExpandableComposite.TITLE_BAR);
section.setText(Messages.snapshotSectionLabel);
section.setLayoutData(new GridData(GridData.FILL_BOTH));
Composite composite = toolkit.createComposite(section);
section.setClient(composite);
composite.setLayout(new GridLayout(2, false));
dateText = createText(composite, toolkit, Messages.dateLabel);
commentsText = createEditableText(composite, toolkit, Messages.commentsLabel);
commentsText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
editor.firePropertyChange(IEditorPart.PROP_DIRTY);
}
});
}
use of org.eclipse.ui.forms.widgets.ExpandableComposite 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.ExpandableComposite in project tdi-studio-se by Talend.
the class TimelineSection method createSection.
/**
* Creates the section.
*
* @param parent The parent composite
* @param group The attribute group
*/
private void createSection(Composite parent, IMonitoredMXBeanGroup group) {
if (parent.isDisposed()) {
return;
}
ExpandableComposite section = getWidgetFactory().createSection(parent, ExpandableComposite.TITLE_BAR);
section.setText(group.getName());
section.setLayoutData(new GridData(GridData.FILL_BOTH));
Composite flatFormComposite = getWidgetFactory().createFlatFormComposite(section);
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);
List<Action> actions = new ArrayList<Action>();
for (IMonitoredMXBeanAttribute attribute : group.getAttributes()) {
if (attribute.getAttributeName().startsWith("HeapMemoryUsage")) {
//$NON-NLS-1$
actions.add(garbageCollectorAction);
break;
}
}
actions.add(new ConfigureChartAction(chart, this));
addSectionActions(section, actions);
}
use of org.eclipse.ui.forms.widgets.ExpandableComposite in project ow by vtst.
the class SWTFactory method createExpandibleComposite.
/**
* Creates an ExpandibleComposite widget
* @param parent the parent to add this widget to
* @param style the style for ExpandibleComposite expanding handle, and layout
* @param label the label for the widget
* @param hspan how many columns to span in the parent
* @param fill the fill style for the widget
* Can be one of <code>GridData.FILL_HORIZONAL</code>, <code>GridData.FILL_BOTH</code> or <code>GridData.FILL_VERTICAL</code>
* @return a new ExpandibleComposite widget
*/
public static ExpandableComposite createExpandibleComposite(Composite parent, int style, String label, int hspan, int fill) {
ExpandableComposite ex = new ExpandableComposite(parent, SWT.NONE, style);
ex.setText(label);
ex.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT));
GridData gd = new GridData(fill);
gd.horizontalSpan = hspan;
ex.setLayoutData(gd);
return ex;
}
use of org.eclipse.ui.forms.widgets.ExpandableComposite in project ow by vtst.
the class SWTFactory method createExpandibleComposite.
/**
* Creates an ExpandibleComposite widget
* @param parent the parent to add this widget to
* @param style the style for ExpandibleComposite expanding handle, and layout
* @param label the label for the widget
* @param hspan how many columns to span in the parent
* @param fill the fill style for the widget
* Can be one of <code>GridData.FILL_HORIZONAL</code>, <code>GridData.FILL_BOTH</code> or <code>GridData.FILL_VERTICAL</code>
* @return a new ExpandibleComposite widget
*/
public static ExpandableComposite createExpandibleComposite(Composite parent, int style, String label, int hspan, int fill) {
ExpandableComposite ex = new ExpandableComposite(parent, SWT.NONE, style);
ex.setText(label);
ex.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT));
GridData gd = new GridData(fill);
gd.horizontalSpan = hspan;
ex.setLayoutData(gd);
return ex;
}
Aggregations