Search in sources :

Example 1 with IActiveJvm

use of org.talend.designer.runtime.visualization.IActiveJvm in project tdi-studio-se by Talend.

the class ShowInTimelineAction method selectionChanged.

/*
     * @see ISelectionChangedListener#selectionChanged(SelectionChangedEvent)
     */
@Override
public void selectionChanged(SelectionChangedEvent event) {
    IActiveJvm jvm = section.getJvm();
    if (!(event.getSelection() instanceof StructuredSelection) || jvm == null || !jvm.isConnected()) {
        setEnabled(false);
        return;
    }
    Object[] elements = ((StructuredSelection) event.getSelection()).toArray();
    if (elements.length == 0) {
        setEnabled(false);
        return;
    }
    boolean enabled = true;
    selections.clear();
    for (Object element : elements) {
        MBeanAttribute attribute = getMBeanAttribute(element);
        if (attribute != null) {
            selections.add(attribute);
        }
        if (!getEnabled(element)) {
            enabled = false;
        }
    }
    setEnabled(enabled);
}
Also used : IActiveJvm(org.talend.designer.runtime.visualization.IActiveJvm) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) MBeanAttribute(org.talend.designer.runtime.visualization.internal.ui.properties.timeline.MBeanAttribute)

Example 2 with IActiveJvm

use of org.talend.designer.runtime.visualization.IActiveJvm in project tdi-studio-se by Talend.

the class ShowInTimelineAction method run.

/*
     * @see Action#run()
     */
@Override
public void run() {
    IActiveJvm jvm = section.getJvm();
    if (jvm == null || selections.isEmpty()) {
        return;
    }
    ShowInTimelineDialog dialog = new ShowInTimelineDialog(Display.getDefault().getActiveShell(), selections.get(0).getAttributeName(), jvm);
    if (dialog.open() == Window.OK) {
        performShowInTimeline(dialog.getChartTitle(), dialog.getAxisUnit(), dialog.getAttributes());
    }
}
Also used : IActiveJvm(org.talend.designer.runtime.visualization.IActiveJvm)

Example 3 with IActiveJvm

use of org.talend.designer.runtime.visualization.IActiveJvm in project tdi-studio-se by Talend.

the class RuntimeGraphcsComposite method createControls.

@Override
protected void createControls(Composite parent) {
    chartsPage = new Composite(parent, SWT.NULL);
    parent.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
    chartsPage.setBackground(parent.getBackground());
    FormLayout formLayout = new FormLayout();
    formLayout.marginWidth = 0;
    formLayout.marginHeight = 0;
    chartsPage.setLayout(formLayout);
    FormData pageData = new FormData();
    pageData.top = new FormAttachment(0, 0);
    pageData.bottom = new FormAttachment(100, 0);
    pageData.left = new FormAttachment(0, 0);
    pageData.right = new FormAttachment(100, 0);
    chartsPage.setLayoutData(pageData);
    mBeanServerChangeListener = new IMBeanServerChangeListener() {

        @Override
        public void serverChanged(MBeanServerEvent event) {
            new RefreshJob(Messages.reconstructChartJobLabel, toString()) {

                @Override
                protected void refreshUI() {
                    IActiveJvm jvm = getJvm();
                    if (jvm != null) {
                        reconstructCharts(jvm, false);
                    }
                }
            }.schedule();
        }
    };
    PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IHelpContextIds.TIMELINE_PAGE);
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) RefreshJob(org.talend.designer.runtime.visualization.internal.ui.RefreshJob) IActiveJvm(org.talend.designer.runtime.visualization.IActiveJvm) Composite(org.eclipse.swt.widgets.Composite) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) IMBeanServerChangeListener(org.talend.designer.runtime.visualization.MBean.IMBeanServerChangeListener) MBeanServerEvent(org.talend.designer.runtime.visualization.MBean.MBeanServerEvent) FormAttachment(org.eclipse.swt.layout.FormAttachment)

Example 4 with IActiveJvm

use of org.talend.designer.runtime.visualization.IActiveJvm in project tdi-studio-se by Talend.

the class RuntimeGraphcsComposite method refresh.

@Override
protected void refresh() {
    refreshConnectionIndicator();
    refreshReportField();
    IActiveJvm jvm = getJvm();
    if (jvm == null || !jvm.isConnected() || isRefreshSuspended() || chartsPage.isDisposed()) {
        return;
    }
    for (TimelineChart chart : charts) {
        if (!chart.isDisposed() && chart.isVisible()) {
            chart.refresh();
        }
    }
}
Also used : IActiveJvm(org.talend.designer.runtime.visualization.IActiveJvm) TimelineChart(org.talend.designer.runtime.visualization.internal.ui.properties.timeline.TimelineChart)

Example 5 with IActiveJvm

use of org.talend.designer.runtime.visualization.IActiveJvm in project tdi-studio-se by Talend.

the class RuntimeGraphcsComposite method refreshConnectionIndicator.

private void refreshConnectionIndicator() {
    IActiveJvm jvm = getJvm();
    boolean isConnected = jvm != null && jvm.isConnected();
    refreshBackground(chartsPage, isConnected);
    for (TimelineChart chart : charts) {
        refreshBackground(chart, isConnected);
        refreshBackground(chart.getPlotArea(), isConnected);
        refreshBackground(chart.getSection(), isConnected);
    }
}
Also used : IActiveJvm(org.talend.designer.runtime.visualization.IActiveJvm) TimelineChart(org.talend.designer.runtime.visualization.internal.ui.properties.timeline.TimelineChart)

Aggregations

IActiveJvm (org.talend.designer.runtime.visualization.IActiveJvm)54 JvmCoreException (org.talend.designer.runtime.visualization.JvmCoreException)14 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)7 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)6 RefreshJob (org.talend.designer.runtime.visualization.internal.ui.RefreshJob)6 IMonitoredMXBeanGroup (org.talend.designer.runtime.visualization.MBean.IMonitoredMXBeanGroup)5 ArrayList (java.util.ArrayList)2 Date (java.util.Date)2 ObjectName (javax.management.ObjectName)2 Job (org.eclipse.core.runtime.jobs.Job)2 IDialogSettings (org.eclipse.jface.dialogs.IDialogSettings)2 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)2 Composite (org.eclipse.swt.widgets.Composite)2 ExpandableComposite (org.eclipse.ui.forms.widgets.ExpandableComposite)2 IHost (org.talend.designer.runtime.visualization.IHost)2 JvmModelEvent (org.talend.designer.runtime.visualization.JvmModelEvent)2 IMBeanServerChangeListener (org.talend.designer.runtime.visualization.MBean.IMBeanServerChangeListener)2 IMonitoredMXBeanAttribute (org.talend.designer.runtime.visualization.MBean.IMonitoredMXBeanAttribute)2 AxisUnit (org.talend.designer.runtime.visualization.MBean.IMonitoredMXBeanGroup.AxisUnit)2 MBeanServerEvent (org.talend.designer.runtime.visualization.MBean.MBeanServerEvent)2