Search in sources :

Example 1 with GarbageCollectorAction

use of org.talend.designer.runtime.visualization.internal.ui.properties.memory.GarbageCollectorAction 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);
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) GarbageCollectorAction(org.talend.designer.runtime.visualization.internal.ui.properties.memory.GarbageCollectorAction) Action(org.eclipse.jface.action.Action) RefreshAction(org.talend.designer.runtime.visualization.internal.actions.RefreshAction) Composite(org.eclipse.swt.widgets.Composite) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) GridData(org.eclipse.swt.layout.GridData) ArrayList(java.util.ArrayList) IMonitoredMXBeanAttribute(org.talend.designer.runtime.visualization.MBean.IMonitoredMXBeanAttribute) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) FormAttachment(org.eclipse.swt.layout.FormAttachment)

Aggregations

ArrayList (java.util.ArrayList)1 Action (org.eclipse.jface.action.Action)1 FormAttachment (org.eclipse.swt.layout.FormAttachment)1 FormData (org.eclipse.swt.layout.FormData)1 FormLayout (org.eclipse.swt.layout.FormLayout)1 GridData (org.eclipse.swt.layout.GridData)1 Composite (org.eclipse.swt.widgets.Composite)1 ExpandableComposite (org.eclipse.ui.forms.widgets.ExpandableComposite)1 IMonitoredMXBeanAttribute (org.talend.designer.runtime.visualization.MBean.IMonitoredMXBeanAttribute)1 RefreshAction (org.talend.designer.runtime.visualization.internal.actions.RefreshAction)1 GarbageCollectorAction (org.talend.designer.runtime.visualization.internal.ui.properties.memory.GarbageCollectorAction)1