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