Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Ferrazzutti2014-06-05 22:12:09 +0000
committerAlexander Kurtakov2014-07-28 08:18:27 +0000
commit789298c66263ddb219c26785ddf0e3c9bcc45131 (patch)
treeee527f325ccad5081be4cb856a4b032ddb9be01b /systemtap
parent2f7e852daae3523e3782541386a58aae8116adf0 (diff)
downloadorg.eclipse.linuxtools-789298c66263ddb219c26785ddf0e3c9bcc45131.tar.gz
org.eclipse.linuxtools-789298c66263ddb219c26785ddf0e3c9bcc45131.tar.xz
org.eclipse.linuxtools-789298c66263ddb219c26785ddf0e3c9bcc45131.zip
Systemtap: Allow graph title visibility toggle.
Change-Id: I56d5c6e4c209b863bb776edb23da7cbb3deafa5e Signed-off-by: Andrew Ferrazzutti <aferrazz@redhat.com> Reviewed-on: https://git.eclipse.org/r/28707 Tested-by: Hudson CI Reviewed-by: Alexander Kurtakov <akurtako@redhat.com> Tested-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'systemtap')
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/META-INF/MANIFEST.MF2
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/pom.xml2
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/systemtap/graphing/ui/GraphDisplaySet.java11
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/systemtap/graphing/ui/widgets/GraphComposite.java54
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/systemtap/graphing/ui/widgets/Messages.java10
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/systemtap/graphing/ui/widgets/messages.properties4
6 files changed, 62 insertions, 21 deletions
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/META-INF/MANIFEST.MF b/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/META-INF/MANIFEST.MF
index 8f6fb5f576..e235604685 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/META-INF/MANIFEST.MF
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %bundleName
Bundle-SymbolicName: org.eclipse.linuxtools.systemtap.graphing.ui;singleton:=true
-Bundle-Version: 3.0.0.qualifier
+Bundle-Version: 3.1.0.qualifier
Bundle-Activator: org.eclipse.linuxtools.internal.systemtap.graphing.ui.GraphingUIPlugin
Bundle-Vendor: %bundleProvider
Bundle-Localization: plugin
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/pom.xml b/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/pom.xml
index 8e8f9f1720..acfb77d371 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/pom.xml
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/pom.xml
@@ -18,7 +18,7 @@
</parent>
<artifactId>org.eclipse.linuxtools.systemtap.graphing.ui</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<name>Linux Tools SystemTap Graphing UI Plug-In</name>
</project>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/systemtap/graphing/ui/GraphDisplaySet.java b/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/systemtap/graphing/ui/GraphDisplaySet.java
index f24244c8d9..e609e0e262 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/systemtap/graphing/ui/GraphDisplaySet.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/systemtap/graphing/ui/GraphDisplaySet.java
@@ -28,6 +28,7 @@ import org.eclipse.linuxtools.systemtap.graphing.core.structures.GraphData;
import org.eclipse.linuxtools.systemtap.graphing.ui.charts.AbstractChartBuilder;
import org.eclipse.linuxtools.systemtap.graphing.ui.datadisplay.DataGrid;
import org.eclipse.linuxtools.systemtap.graphing.ui.widgets.GraphComposite;
+import org.eclipse.linuxtools.systemtap.graphing.ui.widgets.Messages;
import org.eclipse.linuxtools.systemtap.graphing.ui.wizards.dataset.DataSetFactory;
import org.eclipse.linuxtools.systemtap.graphing.ui.wizards.graph.GraphFactory;
import org.eclipse.linuxtools.systemtap.graphing.ui.wizards.graph.SelectGraphAndSeriesWizard;
@@ -258,13 +259,19 @@ public class GraphDisplaySet {
}
}
- public void addGraph(GraphData gd) {
+ public void addGraph(final GraphData gd) {
CTabItem item = new CTabItem(folder, SWT.CLOSE);
item.setText(MessageFormat.format(Localization.getString("GraphDisplaySet.GraphTabTitle"), //$NON-NLS-1$
gd.title, GraphFactory.getGraphName(gd.graphID)));
final GraphComposite gc = new GraphComposite(folder, SWT.FILL, gd, dataSet);
gc.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- gc.addCheckOption("Legend", new SelectionAdapter() { //$NON-NLS-1$
+ gc.addCheckOption(Messages.GraphCompositeTitle, new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ gc.setTitleVisible(((Button)e.getSource()).getSelection());
+ }
+ });
+ gc.addCheckOption(Messages.GraphCompositeLegend, new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
gc.setLegendVisible(((Button)e.getSource()).getSelection());
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/systemtap/graphing/ui/widgets/GraphComposite.java b/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/systemtap/graphing/ui/widgets/GraphComposite.java
index 52cc731849..edf6bd147e 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/systemtap/graphing/ui/widgets/GraphComposite.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/systemtap/graphing/ui/widgets/GraphComposite.java
@@ -28,6 +28,7 @@ import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
/**
* A Composite type to contain a Graph object.
@@ -35,6 +36,15 @@ import org.eclipse.swt.widgets.Composite;
* @author Ryan Morse
*/
public class GraphComposite extends Composite {
+
+ private final Composite xControl;
+ private final Composite yControl;
+
+ private boolean sidebarVisible = false;
+ private AbstractChartBuilder builder;
+ private List<Button> checkOptions;
+ private Composite checkOptionComp;
+
/**
* The default constructor: creates an internal composite for the Graph to render on, asks GraphFactory
* to create the graph from the given GraphData and DataSet, then initializes all buttons and listeners.
@@ -66,7 +76,6 @@ public class GraphComposite extends Composite {
}
configure(true);
-
builder.build();
}
@@ -77,7 +86,7 @@ public class GraphComposite extends Composite {
private void configure(boolean withSidebar) {
sidebarVisible = withSidebar;
- for(Button b:checkOptions) {
+ for (Button b : checkOptions) {
b.setVisible(withSidebar);
}
@@ -97,13 +106,20 @@ public class GraphComposite extends Composite {
layout(true, true);
}
- public void addCheckOption(String title, SelectionListener listener) {
- Button b = new Button(checkOptionComp, SWT.CHECK);
- b.setText(title);
- b.addSelectionListener(listener);
- checkOptions.add(b);
- b.setSelection(true);
- configure(sidebarVisible);
+ public void addCheckOption(final String title, final SelectionListener listener) {
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ Button b = new Button(checkOptionComp, SWT.CHECK);
+ b.setText(title);
+ b.addSelectionListener(listener);
+ checkOptions.add(b);
+ b.setSelection(true);
+ if (sidebarVisible) {
+ configure(true);
+ }
+ }
+ });
}
/**
@@ -114,6 +130,9 @@ public class GraphComposite extends Composite {
}
/**
+ * Set the visibility of the graph's legend.
+ * @param visible Set this to <code>true</code> to show the legend,
+ * or <code>false</code> to hide it.
* @since 3.0
*/
public void setLegendVisible(boolean visible) {
@@ -121,11 +140,14 @@ public class GraphComposite extends Composite {
builder.handleUpdateEvent();
}
- private final Composite xControl;
- private final Composite yControl;
-
- private boolean sidebarVisible = false;
- private AbstractChartBuilder builder;
- private List<Button> checkOptions;
- private Composite checkOptionComp;
+ /**
+ * Set the visibility of the graph's title.
+ * @param visible Set this to <code>true</code> to show the title,
+ * or <code>false</code> to hide it.
+ * @since 3.1
+ */
+ public void setTitleVisible(boolean visible) {
+ builder.getChart().getTitle().setVisible(visible);
+ builder.handleUpdateEvent();
+ }
}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/systemtap/graphing/ui/widgets/Messages.java b/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/systemtap/graphing/ui/widgets/Messages.java
index 994f0020ca..d89cc97e9c 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/systemtap/graphing/ui/widgets/Messages.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/systemtap/graphing/ui/widgets/Messages.java
@@ -35,6 +35,16 @@ public class Messages extends NLS {
public static String GraphDiscreteXControl_All;
public static String GraphDiscreteXControl_Right;
public static String GraphDiscreteXControl_Last;
+
+ /**
+ * @since 3.1
+ */
+ public static String GraphCompositeTitle;
+ /**
+ * @since 3.1
+ */
+ public static String GraphCompositeLegend;
+
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/systemtap/graphing/ui/widgets/messages.properties b/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/systemtap/graphing/ui/widgets/messages.properties
index f8950e6245..9f308b0857 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/systemtap/graphing/ui/widgets/messages.properties
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/systemtap/graphing/ui/widgets/messages.properties
@@ -25,4 +25,6 @@ GraphDiscreteXControl_ZoomIn=Zoom In
GraphDiscreteXControl_ZoomOut=Zoom Out
GraphDiscreteXControl_All=Show All
GraphDiscreteXControl_Right=>
-GraphDiscreteXControl_Last=>> \ No newline at end of file
+GraphDiscreteXControl_Last=>>
+GraphCompositeTitle=Title
+GraphCompositeLegend=Legend \ No newline at end of file

Back to the top