aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Ferrazzutti2013-10-02 11:40:27 (EDT)
committerJeff Johnston2013-11-25 15:58:53 (EST)
commitc4dde12d9db197c4bd39edc15b45ea5594f907bb (patch)
treeb521f38dd7dcdcb990ea3126d6f7921a47639e37
parent4fe26b02693373aa4967437f1737f1a89473ca0c (diff)
downloadorg.eclipse.linuxtools-c4dde12d9db197c4bd39edc15b45ea5594f907bb.zip
org.eclipse.linuxtools-c4dde12d9db197c4bd39edc15b45ea5594f907bb.tar.gz
org.eclipse.linuxtools-c4dde12d9db197c4bd39edc15b45ea5594f907bb.tar.bz2
Systemtap: Allow >1 regexs to parse graph output.refs/changes/48/17048/17
In Run Configurations->Graphing, allow creation of multiple regular expressions for parsing graph output. In other words, enable capturing data from more than one type of pattern from a script's output. Include a test for this feature. Also, deprecate features that are not compatible with this multi-regex setup, such as "Import/Export Datasets" and "Modify Parsing Expression". Change-Id: If77c96567cc7118b8f58a4e0846b9eacfefedf0b Signed-off-by: Andrew Ferrazzutti <aferrazz@redhat.com> Reviewed-on: https://git.eclipse.org/r/17048 Tested-by: Hudson CI Reviewed-by: Jeff Johnston <jjohnstn@redhat.com> IP-Clean: Jeff Johnston <jjohnstn@redhat.com> Tested-by: Jeff Johnston <jjohnstn@redhat.com>
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphingapi.core/src/org/eclipse/linuxtools/systemtap/graphingapi/core/datasets/row/LineParser.java2
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphingapi.core/src/org/eclipse/linuxtools/systemtap/graphingapi/core/structures/GraphData.java51
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/internal/systemtap/graphingapi/ui/localization.properties5
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/dataset/DataSetFactory.java37
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/dataset/DataSetWizard.java6
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/dataset/ParsingWizardPage.java7
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/dataset/SelectDataSetWizardPage.java7
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/dataset/SelectRowParsingWizardPage.java6
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/dataset/SelectTableParsingWizardPage.java6
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/graph/SelectGraphAndSeriesWizard.java6
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/graph/SelectGraphAndSeriesWizardPage.java152
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/internal/systemtap/ui/consolelog/actions/ModifyParsingAction.java4
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/ChartStreamDaemon2.java5
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/ScriptConsolePageParticipant.java5
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/META-INF/MANIFEST.MF2
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/plugin.properties25
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/plugin.xml60
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/pom.xml2
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/internal/systemtap/ui/graphing/actions/ExportDataSetAction.java3
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/internal/systemtap/ui/graphing/actions/ImportDataSetAction.java3
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/internal/systemtap/ui/graphing/actions/OpenScriptOutputAction.java3
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/views/GraphSelectorEditor.java49
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/swtbot/TestCreateSystemtapScript.java294
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/plugin.properties7
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/actions/RunScriptChartHandler.java32
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/launcher/Messages.java19
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/launcher/SystemTapScriptGraphOptionsTab.java939
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/launcher/SystemTapScriptLaunchConfigurationDelegate.java15
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/launcher/messages.properties28
29 files changed, 1337 insertions, 443 deletions
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.core/src/org/eclipse/linuxtools/systemtap/graphingapi/core/datasets/row/LineParser.java b/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.core/src/org/eclipse/linuxtools/systemtap/graphingapi/core/datasets/row/LineParser.java
index 8f9554b..09df7ec 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.core/src/org/eclipse/linuxtools/systemtap/graphingapi/core/datasets/row/LineParser.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.core/src/org/eclipse/linuxtools/systemtap/graphingapi/core/datasets/row/LineParser.java
@@ -48,7 +48,7 @@ public class LineParser implements IDataSetParser {
data[i] = wholeMatcher.group(i+1);
}
e.putRow(0, data);
- s.delete(0, wholeMatcher.end());
+ s.delete(0, s.length());
}
return e;
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.core/src/org/eclipse/linuxtools/systemtap/graphingapi/core/structures/GraphData.java b/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.core/src/org/eclipse/linuxtools/systemtap/graphingapi/core/structures/GraphData.java
index fd2a3e6..e473dc8 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.core/src/org/eclipse/linuxtools/systemtap/graphingapi/core/structures/GraphData.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.core/src/org/eclipse/linuxtools/systemtap/graphingapi/core/structures/GraphData.java
@@ -17,4 +17,55 @@ public class GraphData {
public String key;
public String graphID;
public String title;
+
+ /**
+ * Creates and returns a copy of this GraphData instance.
+ * @return A copy of this GraphData.
+ */
+ public GraphData getCopy() {
+ GraphData gd = new GraphData();
+ gd.xSeries = this.xSeries;
+ gd.ySeries = this.ySeries == null ? null : this.ySeries.clone();
+ gd.key = this.key == null ? null : this.key.substring(0);
+ gd.graphID = this.graphID == null ? null : this.graphID.substring(0);
+ gd.title = this.title == null ? null : this.title.substring(0);
+ return gd;
+ }
+
+ /**
+ * Indicates whether all properties of this GraphData are the same as another GraphData.
+ * @param gd The GraphData to compare with.
+ * @return <code>true</code> if all properties are equal, or <code>false</code> otherwise.
+ */
+ public boolean equals(GraphData gd) {
+ if (gd.ySeries != null && this.ySeries != null) {
+ if (gd.ySeries.length != this.ySeries.length) {
+ return false;
+ }
+ for (int i = 0; i < this.ySeries.length; i++) {
+ if (gd.ySeries[i] != this.ySeries[i]) {
+ return false;
+ }
+ }
+ } else if (gd.ySeries != this.ySeries) {
+ return false;
+ }
+
+ if ((gd.key != this.key)
+ && (gd.key != null && this.key != null && !gd.key.equals(this.key))) {
+ return false;
+ }
+
+ if ((gd.graphID != this.graphID)
+ && (gd.graphID != null && this.graphID != null && !gd.graphID.equals(this.graphID))) {
+ return false;
+ }
+
+ if ((gd.title != this.title)
+ && (gd.title != null && this.title != null && !gd.title.equals(this.title))) {
+ return false;
+ }
+
+ return gd.xSeries == this.xSeries;
+ }
}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/internal/systemtap/graphingapi/ui/localization.properties b/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/internal/systemtap/graphingapi/ui/localization.properties
index 6c85b85..9a7c2c0 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/internal/systemtap/graphingapi/ui/localization.properties
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/internal/systemtap/graphingapi/ui/localization.properties
@@ -140,11 +140,12 @@ SelectGraphAndSeriesWizardPage.Graph=Graph Type:
SelectGraphAndSeriesWizardPage.Title=Title:
SelectGraphAndSeriesWizardPage.XSeries=X Series:
SelectGraphAndSeriesWizardPage.RowID=Row ID
-SelectGraphAndSeriesWizardPage.YSeries=Y Series
+SelectGraphAndSeriesWizardPage.YSeries=Y Series {0}:
SelectGraphAndSeriesWizardPage.TitleNotSet=Title not set
SelectGraphAndSeriesWizardPage.KeyFilter=Key filter:
SelectGraphAndSeriesWizardPage.KeyNotSet=Key not set
SelectGraphAndSeriesWizardPage.NA=NA
SelectGraphAndSeriesWizardPage.Deleted=<Deleted>
SelectGraphAndSeriesWizardPage.UseHistoricalData=Use historical data?
-SelectGraphAndSeriesWizardPage.SeriesNotSelected=Series not selected, or share the same selection
+SelectGraphAndSeriesWizardPage.SeriesDeleted=Series not selected
+SelectGraphAndSeriesWizardPage.SeriesNotUnique=Series share the same selection
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/dataset/DataSetFactory.java b/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/dataset/DataSetFactory.java
index be899ae..4f00d2a 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/dataset/DataSetFactory.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/dataset/DataSetFactory.java
@@ -19,6 +19,7 @@ import org.eclipse.linuxtools.systemtap.graphingapi.core.datasets.row.RowDataSet
import org.eclipse.linuxtools.systemtap.graphingapi.core.datasets.table.FilteredTableDataSet;
import org.eclipse.linuxtools.systemtap.graphingapi.core.datasets.table.TableDataSet;
import org.eclipse.linuxtools.systemtap.graphingapi.ui.datadisplay.DataGrid;
+import org.eclipse.linuxtools.systemtap.graphingapi.ui.wizards.graph.SelectGraphAndSeriesWizard;
import org.eclipse.swt.widgets.Composite;
@@ -51,10 +52,18 @@ public final class DataSetFactory {
return null;
}
+ /**
+ * TODO remove in 3.0
+ */
+ @Deprecated
public static String[] getIDs() {
return ids;
}
+ /**
+ * TODO remove in 3.0
+ */
+ @Deprecated
public static String getName(String id) {
int index = getIndex(id);
if(index >= 0) {
@@ -63,6 +72,10 @@ public final class DataSetFactory {
return null;
}
+ /**
+ * TODO remove in 3.0
+ */
+ @Deprecated
public static String getDescription(String id) {
int index = getIndex(id);
if(index >= 0) {
@@ -71,6 +84,10 @@ public final class DataSetFactory {
return null;
}
+ /**
+ * TODO remove in 3.0
+ */
+ @Deprecated
public static ParsingWizardPage getParsingWizardPage(String id) {
ParsingWizardPage page = null;
@@ -92,6 +109,10 @@ public final class DataSetFactory {
return null;
}
+ /**
+ * TODO remove in 3.0
+ */
+ @Deprecated
private static int getIndex(String id) {
for(int i=0; i<ids.length; i++) {
if(id.equals(ids[i])) {
@@ -101,16 +122,28 @@ public final class DataSetFactory {
return -1;
}
+ /**
+ * TODO remove in 3.0
+ */
+ @Deprecated
private static final String[] ids = {
RowDataSet.ID,
TableDataSet.ID
};
+ /**
+ * TODO remove in 3.0
+ */
+ @Deprecated
private static final String[] names = {
Localization.getString("DataSetFactory.RowDataSet"), //$NON-NLS-1$
Localization.getString("DataSetFactory.TableDataSet") //$NON-NLS-1$
};
+ /**
+ * TODO remove in 3.0
+ */
+ @Deprecated
private static final String[] descriptions = {
Localization.getString("DataSetFactory.RowDataSetDescription") + //$NON-NLS-1$
Localization.getString("DataSetFactory.DataSetExample") + //$NON-NLS-1$
@@ -135,6 +168,10 @@ public final class DataSetFactory {
"-------------------\n" //$NON-NLS-1$
};
+ /**
+ * TODO remove in 3.0
+ */
+ @Deprecated
private static final ParsingWizardPage[] dataSetWizards = new ParsingWizardPage[] {
new SelectRowParsingWizardPage(),
new SelectTableParsingWizardPage()
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/dataset/DataSetWizard.java b/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/dataset/DataSetWizard.java
index e75dcc6..4a7b447 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/dataset/DataSetWizard.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/dataset/DataSetWizard.java
@@ -26,6 +26,12 @@ import org.eclipse.linuxtools.systemtap.graphingapi.core.datasets.IDataSetParser
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;
+/**
+ * @deprecated The means of creating/editing graph configurations has
+ * deviated significantly from this implementation.
+ * TODO remove in 3.0
+ */
+@Deprecated
public class DataSetWizard extends Wizard implements INewWizard {
public DataSetWizard(File metaFile, String scriptFile) {
this.metaFile = metaFile;
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/dataset/ParsingWizardPage.java b/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/dataset/ParsingWizardPage.java
index 001a653..e5ea8df 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/dataset/ParsingWizardPage.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/dataset/ParsingWizardPage.java
@@ -24,7 +24,12 @@ import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
-
+/**
+ * @deprecated The means of creating/editing graph configurations has
+ * deviated significantly from this implementation.
+ * TODO remove in 3.0
+ */
+@Deprecated
public abstract class ParsingWizardPage extends WizardPage {
public ParsingWizardPage(String title) {
super(title);
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/dataset/SelectDataSetWizardPage.java b/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/dataset/SelectDataSetWizardPage.java
index 823500f..ecbcb72 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/dataset/SelectDataSetWizardPage.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/dataset/SelectDataSetWizardPage.java
@@ -25,7 +25,12 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
-
+/**
+ * @deprecated The means of creating/editing graph configurations has
+ * deviated significantly from this implementation.
+ * TODO remove in 3.0
+ */
+@Deprecated
public class SelectDataSetWizardPage extends WizardPage {
public SelectDataSetWizardPage() {
super("selectDataSetType"); //$NON-NLS-1$
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/dataset/SelectRowParsingWizardPage.java b/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/dataset/SelectRowParsingWizardPage.java
index 2df2da7..89f9dc7 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/dataset/SelectRowParsingWizardPage.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/dataset/SelectRowParsingWizardPage.java
@@ -20,6 +20,12 @@ import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
+/**
+ * @deprecated The means of creating/editing graph configurations has
+ * deviated significantly from this implementation.
+ * TODO remove in 3.0
+ */
+@Deprecated
public class SelectRowParsingWizardPage extends ParsingWizardPage {
public SelectRowParsingWizardPage() {
super("selectRowDataSetParsing"); //$NON-NLS-1$
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/dataset/SelectTableParsingWizardPage.java b/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/dataset/SelectTableParsingWizardPage.java
index d0a9bde..46d8082 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/dataset/SelectTableParsingWizardPage.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/dataset/SelectTableParsingWizardPage.java
@@ -23,6 +23,12 @@ import org.eclipse.swt.widgets.Text;
+/**
+ * @deprecated The means of creating/editing graph configurations has
+ * deviated significantly from this implementation.
+ * TODO remove in 3.0
+ */
+@Deprecated
public class SelectTableParsingWizardPage extends ParsingWizardPage {
public SelectTableParsingWizardPage() {
super("selectTableDataSetParsing"); //$NON-NLS-1$
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/graph/SelectGraphAndSeriesWizard.java b/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/graph/SelectGraphAndSeriesWizard.java
index ae789ee..78a06d8 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/graph/SelectGraphAndSeriesWizard.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/graph/SelectGraphAndSeriesWizard.java
@@ -25,6 +25,12 @@ import org.eclipse.ui.IWorkbench;
* @since 2.1
*/
public class SelectGraphAndSeriesWizard extends Wizard implements INewWizard {
+ /**
+ * The wizard for creating a new graph.
+ * @param data An IDataSet that contains the names of all possible series values (columns).
+ * @param gdata A GraphData instance that contains the saved settings of a previously-created graph.
+ * If this wizard is for creating a new graph, set this parameter to null.
+ */
public SelectGraphAndSeriesWizard(IDataSet data, GraphData gdata) {
model = new GraphModel(data);
edit = (gdata != null);
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/graph/SelectGraphAndSeriesWizardPage.java b/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/graph/SelectGraphAndSeriesWizardPage.java
index b88745e..da330f5 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/graph/SelectGraphAndSeriesWizardPage.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/wizards/graph/SelectGraphAndSeriesWizardPage.java
@@ -11,6 +11,8 @@
package org.eclipse.linuxtools.systemtap.graphingapi.ui.wizards.graph;
+import java.text.MessageFormat;
+
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.linuxtools.internal.systemtap.graphingapi.ui.Localization;
import org.eclipse.swt.SWT;
@@ -48,10 +50,9 @@ public class SelectGraphAndSeriesWizardPage extends WizardPage implements Listen
//Set the layout data
Composite comp = new Composite(parent, SWT.NULL);
comp.setLayout(new GridLayout());
- comp.setLayoutData(new GridData(GridData.FILL_BOTH));
Group cmpGraphOptsGraph = new Group(comp, SWT.SHADOW_ETCHED_IN);
- cmpGraphOptsGraph.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+ cmpGraphOptsGraph.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, false, false));
RowLayout rowLayout = new RowLayout();
rowLayout.type = SWT.HORIZONTAL;
rowLayout.spacing = 10;
@@ -72,14 +73,8 @@ public class SelectGraphAndSeriesWizardPage extends WizardPage implements Listen
}
}
- //Add the title widgets
- //data1 = new FormData();
- //data1.top = new FormAttachment(cmpGraphOptsGraph, 10);
-
Group cmpGraphOptsSeries = new Group(comp, SWT.SHADOW_ETCHED_IN);
- cmpGraphOptsSeries.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- //rowLayout = new RowLayout(SWT.VERTICAL);
- //rowLayout.fill = true;
+ cmpGraphOptsSeries.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
GridLayout layout = new GridLayout();
layout.numColumns = 2;
cmpGraphOptsSeries.setLayout(layout);
@@ -95,7 +90,6 @@ public class SelectGraphAndSeriesWizardPage extends WizardPage implements Listen
txtTitle.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
- getWizard().getContainer().updateButtons();
checkErrors();
}
});
@@ -105,11 +99,12 @@ public class SelectGraphAndSeriesWizardPage extends WizardPage implements Listen
cboYItems = new Combo[!edit ? labels.length : Math.max(labels.length, model.getYSeries().length)];
lblYItems = new Label[cboYItems.length];
+ deleted = new boolean[cboYItems.length + 1];
Label lblXItem = new Label(cmpGraphOptsSeries, SWT.NONE);
lblXItem.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
lblXItem.setText(Localization.getString("SelectGraphAndSeriesWizardPage.XSeries")); //$NON-NLS-1$
- cboXItem = new Combo(cmpGraphOptsSeries, SWT.DROP_DOWN);
+ cboXItem = new Combo(cmpGraphOptsSeries, SWT.DROP_DOWN|SWT.READ_ONLY);
cboXItem.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
cboXItem.addSelectionListener(new ComboSelectionListener());
cboXItem.add(Localization.getString("SelectGraphAndSeriesWizardPage.RowID")); //$NON-NLS-1$
@@ -117,8 +112,8 @@ public class SelectGraphAndSeriesWizardPage extends WizardPage implements Listen
for(int i=0; i<cboYItems.length; i++) {
lblYItems[i] = new Label(cmpGraphOptsSeries, SWT.NONE);
lblYItems[i].setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
- lblYItems[i].setText(Localization.getString("SelectGraphAndSeriesWizardPage.YSeries") + i + ":"); //$NON-NLS-1$ //$NON-NLS-2$
- cboYItems[i] = new Combo(cmpGraphOptsSeries, SWT.DROP_DOWN);
+ lblYItems[i].setText(MessageFormat.format(Localization.getString("SelectGraphAndSeriesWizardPage.YSeries"), new Integer(i))); //$NON-NLS-1$
+ cboYItems[i] = new Combo(cmpGraphOptsSeries, SWT.DROP_DOWN|SWT.READ_ONLY);
cboYItems[i].setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
cboYItems[i].addSelectionListener(new ComboSelectionListener());
@@ -136,23 +131,28 @@ public class SelectGraphAndSeriesWizardPage extends WizardPage implements Listen
}
int selected;
- boolean cvisible = edit;
if (!edit) {
cboXItem.select(0);
+ cboYItems[0].select(0);
} else {
selected = model.getXSeries();
if (selected < labels.length){
cboXItem.select(selected + 1);
} else {
- cboXItem.setText(Localization.getString("SelectGraphAndSeriesWizardPage.Deleted")); //$NON-NLS-1$
+ cboXItem.add(Localization.getString("SelectGraphAndSeriesWizardPage.Deleted"), 0); //$NON-NLS-1$
+ cboXItem.select(0);
+ deleted[0] = true;
}
selected = model.getYSeries()[0];
if (selected < labels.length) {
cboYItems[0].select(selected);
} else {
- cboYItems[0].setText(Localization.getString("SelectGraphAndSeriesWizardPage.Deleted")); //$NON-NLS-1$
+ cboYItems[0].add(Localization.getString("SelectGraphAndSeriesWizardPage.Deleted"), 0); //$NON-NLS-1$
+ cboYItems[0].select(0);
+ deleted[1] = true;
}
}
+ boolean cvisible = true;
for(int i=1; i<cboYItems.length; i++) {
if (!edit || model.getYSeries().length <= i) {
cboYItems[i].select(selected = 0);
@@ -161,7 +161,9 @@ public class SelectGraphAndSeriesWizardPage extends WizardPage implements Listen
if (selected < labels.length){
cboYItems[i].select(selected + 1);
} else {
- cboYItems[i].setText(Localization.getString("SelectGraphAndSeriesWizardPage.Deleted")); //$NON-NLS-1$
+ cboYItems[i].add(Localization.getString("SelectGraphAndSeriesWizardPage.Deleted"), 0); //$NON-NLS-1$
+ cboYItems[i].select(0);
+ deleted[i+1] = true;
}
}
cboYItems[i].setVisible(cvisible);
@@ -210,11 +212,11 @@ public class SelectGraphAndSeriesWizardPage extends WizardPage implements Listen
/**
* Saves all information pertaining to series data & naming to the model.
- * @return True if there are no conflicts in series data selection; false otherwise.
- * In the case of the latter, no data is saved.
+ * @return <code>true</code> if there are no conflicts in series data selection,
+ * <code>false</code> otherwise. In the case of the latter, no data is saved.
*/
private boolean saveDataToModelSeries() {
- if(isSeriesUnique()) {
+ if(getErrorMessage() == null) {
model.setTitle(txtTitle.getText());
if(null != txtKey && txtKey.isEnabled())
@@ -240,49 +242,64 @@ public class SelectGraphAndSeriesWizardPage extends WizardPage implements Listen
return false;
}
+ private void markAsDuplicate(Combo item, Boolean bad) {
+ item.setForeground(item.getDisplay().getSystemColor(bad ? SWT.COLOR_RED : SWT.COLOR_BLACK));
+ }
+
/**
* Checks for conflicts in data selection. (An example of a conflict
* is two Y-series fields set to the same output value.)
- * @return True if there is no conflict, false otherwise.
+ * @return <code>true</code> if there is no conflict, <code>false</code> otherwise.
+ * Also visually marks conficting series.
*/
private boolean isSeriesUnique() {
- if("".equals(txtTitle.getText().trim())) { //$NON-NLS-1$
- return false;
- }
- if(null != txtKey && txtKey.isEnabled() && txtKey.getText().length() <= 0) {
- return false;
- }
+ boolean foundDuplicate = false;
- if (cboXItem.getText().contentEquals(Localization.getString("SelectGraphAndSeriesWizardPage.Deleted"))) { //$NON-NLS-1$
- return false;
+ // Undo duplicate marking, as it is to be updated.
+ markAsDuplicate(cboXItem, false);
+ for (int i = 0; i < cboYItems.length; i++) {
+ markAsDuplicate(cboYItems[i], false);
}
for(int j,i=0; i<cboYItems.length; i++) {
- if (cboYItems[i].getText().contentEquals(Localization.getString("SelectGraphAndSeriesWizardPage.Deleted"))) { //$NON-NLS-1$
- return false;
- }
- if(cboYItems[i].isVisible()) {
+ if(cboYItems[i].isVisible() && !deleted[i+1]) {
for(j=i+1; j<cboYItems.length; j++) {
- if(cboYItems[j].isVisible()) {
- if(0 > cboYItems[i].getSelectionIndex())
- return false;
- else if(0 > cboYItems[j].getSelectionIndex())
- return false;
- else if(cboYItems[i].getItem(cboYItems[i].getSelectionIndex()).equals(cboYItems[j].getItem(cboYItems[j].getSelectionIndex()))) {
- return false;
+ try {
+ if(!deleted[j+1] && cboYItems[j].isVisible() && cboYItems[i].getItem(cboYItems[i].getSelectionIndex())
+ .equals(cboYItems[j].getItem(cboYItems[j].getSelectionIndex()))) {
+ markAsDuplicate(cboYItems[i], true);
+ markAsDuplicate(cboYItems[j], true);
+ foundDuplicate = true;
}
+ } catch (Exception e) {
+ // If a cboYItem has no item selected, don't mark any duplicates. Ignore.
}
}
- if(0 > cboYItems[i].getSelectionIndex())
- return false;
- else if(0 > cboXItem.getSelectionIndex())
- return false;
- else if(cboYItems[i].getItem(cboYItems[i].getSelectionIndex()).equals(cboXItem.getItem(cboXItem.getSelectionIndex()))) {
- return false;
+ try {
+ if(!deleted[0] && cboYItems[i].getItem(cboYItems[i].getSelectionIndex()).equals(cboXItem.getItem(cboXItem.getSelectionIndex()))) {
+ markAsDuplicate(cboYItems[i], true);
+ markAsDuplicate(cboXItem, true);
+ foundDuplicate = true;
+ }
+ } catch (Exception e) {
+ // Ignore for same reason as above.
}
}
}
- return true;
+ return !foundDuplicate;
+ }
+
+ /**
+ * Checks for deleted/unselected series entries.
+ * @return <code>true if some value is not selected, <code>false</code> otherwise.
+ */
+ private boolean isSeriesDeleted() {
+ for (int i = 0; i < deleted.length; i++) {
+ if (deleted[i]) {
+ return true;
+ }
+ }
+ return false;
}
@Override
@@ -336,13 +353,32 @@ public class SelectGraphAndSeriesWizardPage extends WizardPage implements Listen
@Override
public void widgetSelected(SelectionEvent e) {
- if(!cboXItem.equals(e.getSource())) {
+ Combo source = (Combo) e.getSource();
+ if(cboXItem.equals(source)) {
+ if (deleted[0] && cboXItem.getSelectionIndex() != 0) {
+ cboXItem.remove(0);
+ deleted[0] = false;
+ }
+ }
+ else {
+ for (int i = 0; i < cboYItems.length; i++) {
+ if (deleted[i+1] && cboYItems[i].equals(source) && cboYItems[i].getSelectionIndex() != 0) {
+ cboYItems[i].remove(0);
+ deleted[i+1] = false;
+ break;
+ }
+ }
boolean setVisible = true;
if(GraphFactory.isMultiGraph(model.getGraphID())) {
for(int i=1; i<cboYItems.length; i++) {
cboYItems[i].setVisible(setVisible);
lblYItems[i].setVisible(setVisible);
- if(cboYItems[i].getSelectionIndex() > 0 && cboYItems[i].isVisible())
+ if (!setVisible && deleted[i+1]) {
+ cboYItems[i].remove(0);
+ deleted[i+1] = false;
+ cboYItems[i].select(0);
+ }
+ if(deleted[i+1] || (cboYItems[i].getSelectionIndex() > 0 && cboYItems[i].isVisible()))
setVisible = true;
else
setVisible = false;
@@ -351,22 +387,21 @@ public class SelectGraphAndSeriesWizardPage extends WizardPage implements Listen
}
checkErrors();
- getWizard().getContainer().updateButtons();
}
}
private void checkErrors(){
- if(!isSeriesUnique()) {
- setErrorMessage(Localization.getString("SelectGraphAndSeriesWizardPage.SeriesNotSelected")); //$NON-NLS-1$
- setMessage(null);
- } else {
- setErrorMessage(null);
- setMessage(""); //$NON-NLS-1$
- }
if(txtTitle.getText().length() == 0) {
setErrorMessage(Localization.getString("SelectGraphAndSeriesWizardPage.TitleNotSet")); //$NON-NLS-1$
- setMessage(null);
+ } else if(!isSeriesUnique()) {
+ setErrorMessage(Localization.getString("SelectGraphAndSeriesWizardPage.SeriesNotUnique")); //$NON-NLS-1$
+ }
+ else if(isSeriesDeleted()) {
+ setErrorMessage(Localization.getString("SelectGraphAndSeriesWizardPage.SeriesDeleted")); //$NON-NLS-1$
+ } else {
+ setErrorMessage(null);
}
+ getWizard().getContainer().updateButtons();
}
private Button[] btnGraphs;
@@ -380,5 +415,6 @@ public class SelectGraphAndSeriesWizardPage extends WizardPage implements Listen
private Combo[] cboYItems;
private Label[] lblYItems;
private GraphModel model;
+ private boolean[] deleted;
private boolean edit;
} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/internal/systemtap/ui/consolelog/actions/ModifyParsingAction.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/internal/systemtap/ui/consolelog/actions/ModifyParsingAction.java
index 921d3b2..a9ad0b8 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/internal/systemtap/ui/consolelog/actions/ModifyParsingAction.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/internal/systemtap/ui/consolelog/actions/ModifyParsingAction.java
@@ -35,7 +35,11 @@ import org.eclipse.ui.PlatformUI;
* The action to allow users to change the parsing expression while a script is actively running.
* @author Ryan Morse
* @since 2.0
+ * @deprecated
+ * TODO By 3.0, this action is to either be removed or made compatible with
+ * the graphing API in place.
*/
+@Deprecated
public class ModifyParsingAction extends ConsoleAction {
public ModifyParsingAction(ScriptConsole fConsole) {
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/ChartStreamDaemon2.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/ChartStreamDaemon2.java
index aceab4d..de04f39 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/ChartStreamDaemon2.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/ChartStreamDaemon2.java
@@ -11,6 +11,7 @@
package org.eclipse.linuxtools.systemtap.ui.consolelog;
+import org.eclipse.linuxtools.internal.systemtap.ui.consolelog.actions.ModifyParsingAction;
import org.eclipse.linuxtools.systemtap.ui.consolelog.structures.ScriptConsole;
import org.eclipse.linuxtools.systemtap.graphingapi.core.datasets.IDataSet;
import org.eclipse.linuxtools.systemtap.graphingapi.core.datasets.IDataSetParser;
@@ -21,10 +22,14 @@ import org.eclipse.linuxtools.systemtap.graphingapi.core.structures.ChartStreamD
* that was received and matched the regExpr
* @author Ryan Morse
* @since 2.0
+ * @deprecated
+ * TODO Unless {@link ModifyParsingAction} is restored, drop this class by 3.0.
*/
+@Deprecated
public class ChartStreamDaemon2 extends ChartStreamDaemon {
public ChartStreamDaemon2(ScriptConsole console, IDataSet d, IDataSetParser p) {
super(d, p);
+ this.console = console;
}
/**
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/ScriptConsolePageParticipant.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/ScriptConsolePageParticipant.java
index 6a0eeb0..d9fb05f 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/ScriptConsolePageParticipant.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/ScriptConsolePageParticipant.java
@@ -10,7 +10,6 @@
package org.eclipse.linuxtools.systemtap.ui.consolelog;
import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.linuxtools.internal.systemtap.ui.consolelog.actions.ModifyParsingAction;
import org.eclipse.linuxtools.internal.systemtap.ui.consolelog.actions.SaveLogAction;
import org.eclipse.linuxtools.internal.systemtap.ui.consolelog.actions.StopScriptAction;
import org.eclipse.linuxtools.systemtap.ui.consolelog.structures.ScriptConsole;
@@ -42,14 +41,14 @@ public class ScriptConsolePageParticipant implements IConsolePageParticipant {
StopScriptAction stopScriptAction = new StopScriptAction(console);
SaveLogAction saveLogAction = new SaveLogAction(console);
- ModifyParsingAction modifyParsingAction = new ModifyParsingAction(console);
// contribute to toolbar
IToolBarManager manager = page.getSite().getActionBars().getToolBarManager();
manager.appendToGroup(IConsoleConstants.LAUNCH_GROUP, stopScriptAction);
manager.appendToGroup(IConsoleConstants.OUTPUT_GROUP, saveLogAction);
- manager.appendToGroup(IConsoleConstants.OUTPUT_GROUP, modifyParsingAction);
+ //TODO if {@link ModifyParsingAction} is restored, it is to be used here,
+ //in the same way stopScriptAction and saveLogAction are used.
}
@Override
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/META-INF/MANIFEST.MF b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/META-INF/MANIFEST.MF
index 1372b33..5e87f8c 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/META-INF/MANIFEST.MF
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %bundleName
Bundle-SymbolicName: org.eclipse.linuxtools.systemtap.ui.graphing;singleton:=true
-Bundle-Version: 2.0.0.qualifier
+Bundle-Version: 2.1.0.qualifier
Bundle-Activator: org.eclipse.linuxtools.internal.systemtap.ui.graphing.GraphingPlugin
Bundle-Vendor: %bundleProvider
Bundle-Localization: plugin
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/plugin.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/plugin.properties
index 94b7334..df74aa9 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/plugin.properties
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/plugin.properties
@@ -1,34 +1,11 @@
bundleName=SystemTap Graphing Plug-In
bundleProvider=Eclipse Linux Tools
-perspective.graphing.name=SystemTap Graphing
-
-view.graphSelector.name=Graph Selector
-
preference.graphing.name=Graphing
-command.open.name=Open Script Output
-command.open.desc=Open script output file
-command.import.name=Import Data Set
-command.import.desc=Import data set from file
-command.export.name=Export Data Set
-command.export.desc=Export data set to file
command.save.name=Save Graph
command.save.desc=Save graph as image
-category.file.name=File2
-cateogry.file.desc=File2
-
actionset.graph.name=Graph Display Action Set
-action.open.name=Open Script Output
-action.open.desc=Open script output file
-action.import.name=Import Data Set
-action.import.desc=Import data set from file
-action.export.name=Export Data Set
-action.export.desc=Export data set to file
action.save.name=Save Graph
-action.save.desc=Save graph as image
-
-actionset.parsing.name=Parsing Action Set
-action.modifyParsing.name=Modify Parsing Expression
-action.modifyParsing.desc=Modify Parsing Expression
+action.save.desc=Save graph as image \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/plugin.xml b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/plugin.xml
index d0b4c7e..63be536 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/plugin.xml
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/plugin.xml
@@ -18,40 +18,10 @@
<extension
point="org.eclipse.ui.commands">
<command
- name="%command.open.name"
- description="%command.open.desc"
- categoryId="org.eclipse.linuxtools.systemtap.ui.graphing.category.file"
- id="org.eclipse.linuxtools.systemtap.ui.graphing.commands.OpenScriptOutput"/>
- <command
- name="%command.export.name"
- description="%command.export.desc"
- categoryId="org.eclipse.linuxtools.systemtap.ui.graphing.category.file"
- id="org.eclipse.linuxtools.systemtap.ui.graphing.commands.ExportDataSet"/>
- <command
name="%command.save.name"
description="%command.save.desc"
categoryId="org.eclipse.linuxtools.systemtap.ui.graphing.category.file"
id="org.eclipse.linuxtools.systemtap.ui.graphing.commands.SaveGraphImage"/>
- <command
- name="%command.import.name"
- description="%command.import.desc"
- categoryId="org.eclipse.linuxtools.systemtap.ui.graphing.category.file"
- id="org.eclipse.linuxtools.systemtap.ui.graphing.commands.ImportDataSet"/>
-
- <category
- name="%category.file.name"
- description="%category.file.desc"
- id="org.eclipse.linuxtools.systemtap.ui.graphing.category.file"/>
- <command
- name="%action.modifyParsing.name"
- description="%action.modifyParsing.desc"
- categoryId="org.eclipse.linuxtools.systemtap.ui.graphing.category.edit"
- id="org.eclipse.linuxtools.systemtap.ui.graphing.commands.ModifyParsing"/>
-
- <category
- name="%category.edit.name"
- description="%category.edit.desc"
- id="org.eclipse.linuxtools.systemtap.ui.graphing.category.edit"/>
</extension>
@@ -71,36 +41,6 @@
definitionId="org.eclipse.linuxtools.systemtap.ui.graphing.commands.SaveGraphImage"
style="push"
state="false"/>
- <action
- label="%action.export.name"
- tooltip="%action.export.desc"
- id="org.eclipse.linuxtools.systemtap.ui.graphing.actions.ExportDataSet"
- icon="icons/actions/export_wiz.gif"
- toolbarPath="org.eclipse.ui.workbench.file/export.ext"
- class="org.eclipse.linuxtools.internal.systemtap.ui.graphing.actions.ExportDataSetAction"
- definitionId="org.eclipse.linuxtools.systemtap.ui.graphing.commands.ExportDataSet"
- style="push"
- state="false"/>
- <action
- label="%action.import.name"
- tooltip="%action.import.desc"
- id="org.eclipse.linuxtools.systemtap.ui.graphing.actions.ImportDataSet"
- icon="icons/actions/import_wiz.gif"
- toolbarPath="org.eclipse.ui.workbench.file/import.ext"
- class="org.eclipse.linuxtools.internal.systemtap.ui.graphing.actions.ImportDataSetAction"
- definitionId="org.eclipse.linuxtools.systemtap.ui.graphing.commands.ImportDataSet"
- style="push"
- state="false"/>
- <action
- label="%action.open.name"
- tooltip="%action.open.desc"
- id="org.eclipse.linuxtools.systemtap.ui.graphing.actions.OpenScriptOutput"
- icon="icons/actions/open_wiz.gif"
- toolbarPath="org.eclipse.ui.workbench.file/new.ext"
- class="org.eclipse.linuxtools.internal.systemtap.ui.graphing.actions.OpenScriptOutputAction"
- definitionId="org.eclipse.linuxtools.systemtap.ui.graphing.commands.OpenScriptOutput"
- style="push"
- state="false"/>
</actionSet>
</extension>
<extension
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/pom.xml b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/pom.xml
index b37e710..2c4413b 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/pom.xml
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/pom.xml
@@ -18,7 +18,7 @@
</parent>
<artifactId>org.eclipse.linuxtools.systemtap.ui.graphing</artifactId>
- <version>2.0.0-SNAPSHOT</version>
+ <version>2.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<name>Linux Tools SystemTap Graphing Plug-in</name>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/internal/systemtap/ui/graphing/actions/ExportDataSetAction.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/internal/systemtap/ui/graphing/actions/ExportDataSetAction.java
index 7e0cbb6..b80af14 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/internal/systemtap/ui/graphing/actions/ExportDataSetAction.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/internal/systemtap/ui/graphing/actions/ExportDataSetAction.java
@@ -32,7 +32,10 @@ import org.eclipse.ui.PlatformUI;
* This action handles exporting all of the data that was collected for the DataSet. It
* exports everything as a table, that can easily be read back in at a later time.
* @author Ryan Morse
+ * @deprecated
+ * TODO remove in 3.0
*/
+@Deprecated
public class ExportDataSetAction extends Action implements IWorkbenchWindowActionDelegate {
@Override
public void init(IWorkbenchWindow window) {
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/internal/systemtap/ui/graphing/actions/ImportDataSetAction.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/internal/systemtap/ui/graphing/actions/ImportDataSetAction.java
index 6d95a6a..fb1be36 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/internal/systemtap/ui/graphing/actions/ImportDataSetAction.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/internal/systemtap/ui/graphing/actions/ImportDataSetAction.java
@@ -40,7 +40,10 @@ import org.eclipse.ui.PlatformUI;
* It allows users to bring up data from previous runs of stap so they can
* see old data. Importing DataSets is no different then a script live and getting data.
* @author Ryan Morse
+ * @deprecated
+ * TODO remove in 3.0
*/
+@Deprecated
public class ImportDataSetAction extends Action implements IWorkbenchWindowActionDelegate {
@Override
public void init(IWorkbenchWindow window) {
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/internal/systemtap/ui/graphing/actions/OpenScriptOutputAction.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/internal/systemtap/ui/graphing/actions/OpenScriptOutputAction.java
index 4783c37..d45ad38 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/internal/systemtap/ui/graphing/actions/OpenScriptOutputAction.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/internal/systemtap/ui/graphing/actions/OpenScriptOutputAction.java
@@ -45,7 +45,10 @@ import org.eclipse.ui.PlatformUI;
* It will act just like the user is running a script with graphing, but will
* not cause update events.
* @author Ryan Morse
+ * @deprecated
+ * TODO remove in 3.0
*/
+@Deprecated
public class OpenScriptOutputAction extends Action implements IWorkbenchWindowActionDelegate {
@Override
public void init(IWorkbenchWindow window) {
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/views/GraphSelectorEditor.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/views/GraphSelectorEditor.java
index ee12e6a..664aa8e 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/views/GraphSelectorEditor.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/views/GraphSelectorEditor.java
@@ -12,6 +12,7 @@
package org.eclipse.linuxtools.systemtap.ui.graphing.views;
import java.util.ArrayList;
+import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.linuxtools.internal.systemtap.ui.graphing.views.Messages;
@@ -64,7 +65,10 @@ public class GraphSelectorEditor extends EditorPart {
* @param title The name to be shown on the new tab
* @param dataSet The <code>IDataSet</code> for the new script set
* @since 2.0
+ * @deprecated See {@link GraphSelectorEditor#createScriptSets}
+ * TODO drop in 3.0
*/
+ @Deprecated
public void createScriptSet(String title, IDataSet dataSet) {
CTabItem item;
@@ -81,6 +85,39 @@ public class GraphSelectorEditor extends EditorPart {
}
/**
+ * This method will create a new script set for each of the provided dataSets.
+ * Each new script set will be given a new tab item at the end of the list.
+ * @param scriptName The full name of the script that is being monitored.
+ * @param titles The names to be shown on each new tab
+ * @param dataSets The <code>IDataSet</code>s for each new script set
+ * @since 2.2
+ */
+ public void createScriptSets(String scriptName, List<String> titles, List<IDataSet> dataSets) {
+ CTabItem item = null;
+
+ for (int i = 0, n = titles.size(); i < n; i++) {
+ item = new CTabItem(scriptFolder, SWT.CLOSE);
+ item.setText(titles.get(i));
+ Composite parent = new Composite(scriptFolder, SWT.NONE);
+ GraphDisplaySet gds = new GraphDisplaySet(parent, dataSets.get(i));
+ displaySets.add(gds);
+ item.setControl(parent);
+ }
+
+ scriptFolder.setSelection(item); // Choose the last created item.
+ fireTabOpenEvent();
+ this.setPartName(NLS.bind(Messages.GraphSelectorEditor_graphsEditorTitle, scriptName.substring(scriptName.lastIndexOf('/')+1)));
+ }
+
+ /**
+ * @return The current number of script sets (one for each regular expression being watched).
+ * @since 2.2
+ */
+ public int numberOfScriptSets() {
+ return displaySets.size();
+ }
+
+ /**
* This method creates the framework for what will be displayed by this dialog box.
* @param parent The composite that will contain all the elements from this dialog
*/
@@ -129,7 +166,17 @@ public class GraphSelectorEditor extends EditorPart {
* @since 2.0
*/
public GraphDisplaySet getActiveDisplaySet() {
- int index = scriptFolder.getSelectionIndex();
+ return getDisplaySet(scriptFolder.getSelectionIndex());
+ }
+
+ /**
+ * Finds and returns the component of the provided index.
+ * @param index The index of the GraphDisplaySet to return
+ * @return The <code>GraphDisplaySet</code> of the provided
+ * index, or null if the index is out of range.
+ * @since 2.2
+ */
+ public GraphDisplaySet getDisplaySet(int index) {
if(index >= 0 && index < displaySets.size()) {
return displaySets.get(index);
} else {
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/swtbot/TestCreateSystemtapScript.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/swtbot/TestCreateSystemtapScript.java
index 854e1b9..0561f09 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/swtbot/TestCreateSystemtapScript.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/swtbot/TestCreateSystemtapScript.java
@@ -16,12 +16,18 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
+import java.text.MessageFormat;
+import java.util.List;
+
import org.eclipse.linuxtools.internal.systemtap.ui.ide.launcher.Messages;
+import org.eclipse.linuxtools.systemtap.graphingapi.ui.charts.ScatterChartBuilder;
+import org.eclipse.linuxtools.systemtap.graphingapi.ui.wizards.graph.GraphFactory;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.finders.ContextMenuHelper;
@@ -29,10 +35,12 @@ import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
import org.eclipse.swtbot.swt.finder.results.VoidResult;
import org.eclipse.swtbot.swt.finder.waits.DefaultCondition;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCTabItem;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotText;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
@@ -201,20 +209,9 @@ public class TestCreateSystemtapScript {
editor.typeText(0, editor.getText().length(), "}");
editor.save();
- // Focus on project explorer view.
- bot.viewByTitle("Project Explorer").setFocus();
- bot.activeShell();
- SWTBotTree treeBot = bot.tree();
- treeBot.setFocus();
- SWTBotTreeItem node = treeBot.expandNode((SYSTEMTAP_PROJECT_NAME));
- bot.waitUntil(new NodeAvaiable(node, scriptName));
-
- treeBot.expandNode(SYSTEMTAP_PROJECT_NAME).expand().select(scriptName);
-
- MenuItem menu = ContextMenuHelper.contextMenu(treeBot, "Run As", "Run Configurations...");
- click(menu);
-
+ openRunConfigurations(scriptName);
SWTBotShell shell = bot.shell("Run Configurations");
+ shell.setFocus();
SWTBotTree runConfigurationsTree = bot.tree();
runConfigurationsTree.select("SystemTap").contextMenu("New").click();
@@ -238,19 +235,7 @@ public class TestCreateSystemtapScript {
String scriptName = "missingColumns.stp";
createScript(bot, scriptName);
- // Focus on project explorer view.
- bot.viewByTitle("Project Explorer").setFocus();
- bot.activeShell();
- SWTBotTree treeBot = bot.tree();
- treeBot.setFocus();
- SWTBotTreeItem node = treeBot.expandNode((SYSTEMTAP_PROJECT_NAME));
- bot.waitUntil(new NodeAvaiable(node, scriptName));
-
- treeBot.expandNode(SYSTEMTAP_PROJECT_NAME).expand().select(scriptName);
-
- MenuItem menu = ContextMenuHelper.contextMenu(treeBot, "Run As", "Run Configurations...");
- click(menu);
-
+ openRunConfigurations(scriptName);
SWTBotShell shell = bot.shell("Run Configurations");
shell.setFocus();
@@ -265,22 +250,15 @@ public class TestCreateSystemtapScript {
bot.checkBox(Messages.SystemTapScriptGraphOptionsTab_2).click();
// As soon as the Graphing tab is entered, no regular expression exists & nothing can be run.
- SWTBotText text = bot.textWithLabel("Regular Expression:");
- assertEquals("", text.getText());
+ SWTBotCombo combo = bot.comboBoxWithLabel(Messages.SystemTapScriptGraphOptionsTab_regexLabel);
+ assertEquals("", combo.getText());
assertTrue(!bot.button("Run").isEnabled());
assertTrue(!bot.button(Messages.SystemTapScriptGraphOptionsTab_AddGraphButton).isEnabled());
- text.setText("(1)(2)");
- assertEquals("(1)(2)", text.getText());
+ combo.setText("(1)(2)");
+ assertEquals("(1)(2)", combo.getText());
assertTrue(bot.button("Run").isEnabled());
assertTrue(bot.button(Messages.SystemTapScriptGraphOptionsTab_AddGraphButton).isEnabled());
- text = bot.text("", 1);
- text.setText("Val 1");
- assertEquals("Val 1", text.getText());
- text = bot.text("", 1);
- text.setText("Val 2");
- assertEquals("Val 2", text.getText());
-
bot.button(Messages.SystemTapScriptGraphOptionsTab_AddGraphButton).click();
setupGraph("Graph");
@@ -288,10 +266,10 @@ public class TestCreateSystemtapScript {
assertTrue(bot.button("Run").isEnabled());
// Removing groups from the regex disables graphs that rely on those groups.
- text = bot.textWithLabel("Regular Expression:");
- text.setText("(1)");
+ combo = bot.comboBoxWithLabel(Messages.SystemTapScriptGraphOptionsTab_regexLabel);
+ combo.setText("(1)");
assertTrue(!bot.button("Run").isEnabled());
- text.setText("(1)(2)(3)");
+ combo.setText("(1)(2)(3)");
assertTrue(bot.button("Run").isEnabled());
shell.setFocus();
@@ -300,6 +278,242 @@ public class TestCreateSystemtapScript {
bot.waitUntil(new ShellIsClosed(shell));
}
+ @Test
+ public void testDeleteBlankRegex(){
+ createScript(bot, "blank.stp");
+ openRunConfigurations("blank.stp");
+ SWTBotShell shell = bot.shell("Run Configurations");
+ shell.setFocus();
+
+ SWTBotTree runConfigurationsTree = bot.tree();
+ runConfigurationsTree.select("SystemTap").contextMenu("New").click();
+
+ // Select the "Graphing" tab.
+ SWTBotCTabItem tab = bot.cTabItem(Messages.SystemTapScriptGraphOptionsTab_7);
+ tab.activate();
+
+ // Enable output graphing.
+ bot.checkBox(Messages.SystemTapScriptGraphOptionsTab_2).click();
+
+ // Confirm that adding a new regex when the current one is blank has no effect.
+ SWTBotCombo combo = bot.comboBoxWithLabel(Messages.SystemTapScriptGraphOptionsTab_regexLabel);
+ assertEquals(2, combo.itemCount());
+ combo.setSelection(1);
+ assertEquals(2, combo.itemCount());
+ assertEquals(0, combo.selectionIndex());
+
+ // Confirm that adding a regex works when the current regex is not empty.
+ combo.setText("(a) b (c)");
+ assertEquals("(a) b (c)", combo.getText());
+ combo.setSelection(1);
+ assertEquals(3, combo.itemCount());
+ assertEquals(1, combo.selectionIndex());
+
+ // Confirm that a blank regex is not removed when other data is not empty.
+ combo.setText("(a)");
+ bot.button(Messages.SystemTapScriptGraphOptionsTab_AddGraphButton).click();
+ SWTBotShell shell2 = bot.shell("Create Graph");
+ shell2.setFocus();
+ bot.textWithLabel("Title:").setText("Test");
+ bot.button("Finish").click();
+ bot.waitUntil(new ShellIsClosed(shell2));
+ shell.setFocus();
+ combo.setText("");
+ assertEquals("", combo.getText());
+ combo.setSelection(0);
+ assertEquals(3, combo.itemCount());
+
+ // Confirm that auto-deleting a blank regex in the middle of the regex list works properly.
+ combo.setSelection(2);
+ assertEquals(4, combo.itemCount());
+ combo.setText("sample");
+ combo.setSelection(1);
+ assertEquals(4, combo.itemCount());
+ SWTBotTable table = bot.table(0);
+ SWTBotButton button = bot.button(Messages.SystemTapScriptGraphOptionsTab_RemoveGraphButton);
+ assertTrue(!button.isEnabled());
+ table.select(0);
+ assertTrue(button.isEnabled());
+ button.click();
+ assertTrue(!button.isEnabled());
+ combo.setSelection(2);
+ assertEquals(3, combo.itemCount());
+ assertEquals("sample", combo.getText());
+ assertEquals("(a) b (c)", combo.items()[0]);
+ assertEquals("sample", combo.items()[1]);
+
+ // Confirm that auto-deleting a regex from the beginning of the list works properly.
+ combo.setSelection(2);
+ combo.setText("another sample");
+ combo.setSelection(0);
+ combo.setText("");
+ combo.setSelection(1);
+ assertEquals(3, combo.itemCount());
+ assertEquals("sample", combo.getText());
+ assertEquals("sample", combo.items()[0]);
+ assertEquals("another sample", combo.items()[1]);
+
+ bot.button("Close").click();
+ shell2 = bot.shell("Save Changes");
+ shell2.setFocus();
+ bot.button("No").click();
+ bot.waitUntil(new ShellIsClosed(shell));
+ }
+
+ @Test
+ public void testGraphScript(){
+ String scriptName = "testGraph.stp";
+ createScript(bot, scriptName);
+
+ // Write a script
+ SWTBotEclipseEditor editor = bot.editorByTitle(scriptName).toTextEditor();
+ editor.setText("#!/usr/bin/env stap"
+ + "\nglobal i,j,k"
+ + "\nprobe begin{i=0;j=0;k=0}"
+ + "\nprobe timer.ms(100){printf(\"Value:%d %d\\n\",i,j);i++;j+=2}"
+ + "\nprobe timer.ms(250){printf(\"Other:%d %d\\n\",i,k);k++}");
+ editor.save();
+
+ String val0 = "i";
+ String val1 = "j";
+ String val2 = "k";
+
+ openRunConfigurations(scriptName);
+ SWTBotShell shell = bot.shell("Run Configurations");
+ shell.setFocus();
+
+ SWTBotTree runConfigurationsTree = bot.tree();
+ runConfigurationsTree.select("SystemTap").contextMenu("New").click();
+ bot.textWithLabel("Name:").setText(scriptName);
+
+ // Select the "Graphing" tab.
+ SWTBotCTabItem tab = bot.cTabItem(Messages.SystemTapScriptGraphOptionsTab_7);
+ tab.activate();
+
+ // Enable output graphing.
+ bot.checkBox(Messages.SystemTapScriptGraphOptionsTab_2).click();
+ SWTBotCombo combo = bot.comboBoxWithLabel(Messages.SystemTapScriptGraphOptionsTab_regexLabel);
+ combo.setText("Value:(\\d+) (\\d+)");
+ assertEquals("Value:(\\d+) (\\d+)", combo.getText());
+
+ SWTBotText text = bot.textWithLabel(Messages.SystemTapScriptGraphOptionsTab_sampleOutputLabel);
+ text.setText("Value:1 2");
+ assertEquals("Value:1 2", text.getText());
+
+ text = bot.text(MessageFormat.format(Messages.SystemTapScriptGraphOptionsTab_defaultColumnTitleBase, 1));
+ text.setText(val0);
+ assertEquals(val0, text.getText());
+ text = bot.text(MessageFormat.format(Messages.SystemTapScriptGraphOptionsTab_defaultColumnTitleBase, 2));
+ text.setText(val1);
+ assertEquals(val1, text.getText());
+
+ // Add a graph.
+ bot.button(Messages.SystemTapScriptGraphOptionsTab_AddGraphButton).click();
+ setupGraph("Values");
+
+ // Make a second regex, and a graph for it.
+ shell.setFocus();
+ combo = bot.comboBoxWithLabel(Messages.SystemTapScriptGraphOptionsTab_regexLabel);
+ assertEquals(2, combo.itemCount());
+ combo.setSelection(combo.selectionIndex() + 1);
+ assertEquals(3, combo.itemCount());
+ assertEquals("", combo.getText());
+ combo.setText("Other:(\\d+) (\\d+)");
+ assertEquals("Other:(\\d+) (\\d+)", combo.getText());
+
+ text = bot.text(MessageFormat.format(Messages.SystemTapScriptGraphOptionsTab_defaultColumnTitleBase, 1));
+ text.setText(val0);
+ assertEquals(val0, text.getText());
+ text = bot.text(MessageFormat.format(Messages.SystemTapScriptGraphOptionsTab_defaultColumnTitleBase, 2));
+ text.setText(val2);
+ assertEquals(val2, text.getText());
+
+ text = bot.textWithLabel(Messages.SystemTapScriptGraphOptionsTab_sampleOutputLabel);
+ assertEquals("", text.getText());
+
+ bot.button(Messages.SystemTapScriptGraphOptionsTab_AddGraphButton).click();
+ setupGraph("Others");
+
+ // Apply the changes, then close the menu & reopen it to make sure settings were saved.
+ shell.setFocus();
+ bot.button("Apply").click();
+ bot.button("Close").click();
+ bot.waitUntil(new ShellIsClosed(shell));
+ openRunConfigurations(scriptName);
+ shell = bot.shell("Run Configurations");
+ shell.setFocus();
+ bot.tree().expandNode("SystemTap").select(scriptName);
+ tab = bot.cTabItem(Messages.SystemTapScriptGraphOptionsTab_7);
+ tab.activate();
+
+ combo = bot.comboBoxWithLabel(Messages.SystemTapScriptGraphOptionsTab_regexLabel);
+ text = bot.textWithLabel(Messages.SystemTapScriptGraphOptionsTab_sampleOutputLabel);
+ SWTBotTable table = bot.table(0);
+ assertEquals(3, combo.itemCount());
+ assertEquals("Value:(\\d+) (\\d+)", combo.getText());
+ assertEquals("Value:1 2", text.getText());
+ assertEquals(1, table.rowCount());
+ assertTrue(table.containsItem(GraphFactory.getGraphName(ScatterChartBuilder.ID) + ":Values"));
+ combo.setSelection(1);
+ assertEquals("Other:(\\d+) (\\d+)", combo.getText());
+ assertEquals("", text.getText());
+ assertEquals(1, table.rowCount());
+ assertTrue(table.containsItem(GraphFactory.getGraphName(ScatterChartBuilder.ID) + ":Others"));
+
+ // If Systemtap is not installed, don't test graph output. Otherwise, do.
+ if (!stapInstalled) {
+ bot.button("Close").click();
+ bot.waitUntil(new ShellIsClosed(shell));
+ return;
+ }
+
+ bot.button("Run").click();
+ bot.waitUntil(new ShellIsClosed(shell));
+ bot.sleep(2500); // Let the script run for a moment
+ SWTBotView console = bot.viewById("org.eclipse.ui.console.ConsoleView");
+ console.setFocus();
+ console.toolbarButton("Stop Script").click(); // Stop the script manually
+ bot.waitUntil(new StapHasExited(), 10000);
+
+ bot.sleep(1000); // Give time for the table to be fully constructed
+ SWTBotEditor graphDisplay = bot.activeEditor();
+ graphDisplay.setFocus();
+ graphDisplay.bot().cTabItem(MessageFormat.format(Messages.SystemTapScriptGraphOptionsTab_graphSetTitleBase, 1)).activate();
+ graphDisplay.bot().cTabItem("Data View").activate();
+ SWTBotTable dataTable = bot.table(0);
+ List<String> colNames = dataTable.columns();
+ assertEquals(3, colNames.size());
+ assertEquals(val0, colNames.get(1));
+ assertEquals(val1, colNames.get(2));
+ assertEquals("3", dataTable.cell(3, 1));
+ assertEquals("6", dataTable.cell(3, 2));
+
+ graphDisplay.bot().cTabItem(MessageFormat.format(Messages.SystemTapScriptGraphOptionsTab_graphSetTitleBase, 2)).activate();
+ graphDisplay.bot().cTabItem("Data View").activate();
+ dataTable = bot.table(0);
+ colNames = dataTable.columns();
+ assertEquals(3, colNames.size());
+ assertEquals(val0, colNames.get(1));
+ assertEquals(val2, colNames.get(2));
+ assertEquals("10", dataTable.cell(3, 1));
+ assertEquals("3", dataTable.cell(3, 2));
+ }
+
+ private void openRunConfigurations(String scriptName) {
+ // Focus on project explorer view.
+ bot.viewByTitle("Project Explorer").setFocus();
+ bot.activeShell();
+ SWTBotTree treeBot = bot.tree();
+ treeBot.setFocus();
+ SWTBotTreeItem node = treeBot.expandNode(SYSTEMTAP_PROJECT_NAME);
+ bot.waitUntil(new NodeAvaiable(node, scriptName));
+
+ treeBot.expandNode(SYSTEMTAP_PROJECT_NAME).expand().select(scriptName);
+
+ MenuItem menu = ContextMenuHelper.contextMenu(treeBot, "Run As", "Run Configurations...");
+ click(menu);
+ }
+
private void setupGraph(String title) {
SWTBotShell shell = bot.shell("Create Graph");
shell.setFocus();
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/plugin.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/plugin.properties
index 699b520..9a259e5 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/plugin.properties
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/plugin.properties
@@ -34,8 +34,6 @@ command.insertFunction.name=Insert Function
command.insertFunction.desc=Insert this function
command.runChart.name=Run w/Chart
command.runChart.desc=Run the Script w/Chart
-command.modifyParsing.name=Modify Parsing Expression
-command.modifyParsing.desc=Modify Parsing Expression
category.file.name=File
category.file.desc=File
@@ -65,11 +63,6 @@ action.viewDefinition.name=View Definition
actionset.file.name=File Action Set
actionset.run.name=Run Action Set
-
-actionset.parsing.name=Parsing Action Set
-action.modifyParsing.name=Modify Parsing Expression
-action.modifyParsing.desc=Modify Parsing Expression
-
category.name=Systemtap
wizard.name=Systemtap Script
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/actions/RunScriptChartHandler.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/actions/RunScriptChartHandler.java
index a0d26fe..f81a143 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/actions/RunScriptChartHandler.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/actions/RunScriptChartHandler.java
@@ -12,13 +12,14 @@
package org.eclipse.linuxtools.internal.systemtap.ui.ide.actions;
import java.util.LinkedList;
+import java.util.List;
import org.eclipse.linuxtools.internal.systemtap.ui.ide.IDEPerspective;
import org.eclipse.linuxtools.systemtap.graphingapi.core.datasets.IDataSet;
import org.eclipse.linuxtools.systemtap.graphingapi.core.datasets.IDataSetParser;
+import org.eclipse.linuxtools.systemtap.graphingapi.core.structures.ChartStreamDaemon;
import org.eclipse.linuxtools.systemtap.graphingapi.core.structures.GraphData;
import org.eclipse.linuxtools.systemtap.graphingapi.ui.widgets.ExceptionErrorDialog;
-import org.eclipse.linuxtools.systemtap.ui.consolelog.ChartStreamDaemon2;
import org.eclipse.linuxtools.systemtap.ui.consolelog.structures.ScriptConsole;
import org.eclipse.linuxtools.systemtap.ui.graphing.views.GraphSelectorEditor;
import org.eclipse.linuxtools.systemtap.ui.graphing.views.GraphSelectorEditorInput;
@@ -33,29 +34,36 @@ import org.eclipse.ui.WorkbenchException;
*/
public class RunScriptChartHandler extends RunScriptHandler {
- private IDataSet dataSet;
- private IDataSetParser parser;
- private LinkedList<GraphData> graphs;
+ private List<IDataSetParser> parsers;
+ private List<IDataSet> dataSets;
+ private List<String> names;
+ private List<LinkedList<GraphData>> graphs;
- public RunScriptChartHandler(IDataSetParser parser, IDataSet dataSet, LinkedList<GraphData> graphs) {
+ public RunScriptChartHandler(List<IDataSetParser> parsers, List<IDataSet> dataSet, List<String> names, List<LinkedList<GraphData>> graphs) {
super();
- this.parser = parser;
- this.dataSet = dataSet;
+ this.parsers = parsers;
+ this.dataSets = dataSet;
+ this.names = names;
this.graphs = graphs;
}
@Override
protected void scriptConsoleInitialized(ScriptConsole console){
- console.getCommand().addInputStreamListener(new ChartStreamDaemon2(console, dataSet, parser));
+ int n = parsers.size();
+ for (int i = 0; i < n; i++) {
+ console.getCommand().addInputStreamListener(new ChartStreamDaemon(dataSets.get(i), parsers.get(i)));
+ }
try {
IWorkbenchPage p = PlatformUI.getWorkbench().showPerspective(IDEPerspective.ID, PlatformUI.getWorkbench().getActiveWorkbenchWindow());
GraphSelectorEditor ivp = (GraphSelectorEditor)p.openEditor(new GraphSelectorEditorInput(), GraphSelectorEditor.ID);
- String name = console.getName();
- ivp.createScriptSet(name.substring(name.lastIndexOf('/')+1), dataSet);
+ String scriptName = console.getName();
+ ivp.createScriptSets(scriptName, names, dataSets);
- for (GraphData graph : graphs) {
- ivp.getActiveDisplaySet().addGraph(graph);
+ for (int i = 0; i < n; i++) {
+ for (GraphData graph : graphs.get(i)) {
+ ivp.getDisplaySet(i).addGraph(graph);
+ }
}
} catch(WorkbenchException we) {
ExceptionErrorDialog.openError(Messages.RunScriptChartAction_couldNotSwitchToGraphicPerspective, we);
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/launcher/Messages.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/launcher/Messages.java
index 32d8934..2a1a9db 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/launcher/Messages.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/launcher/Messages.java
@@ -17,11 +17,6 @@ import org.eclipse.osgi.util.NLS;
public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.linuxtools.internal.systemtap.ui.ide.launcher.messages"; //$NON-NLS-1$
- public static String ParsingWizardPage_Title;
- public static String ParsingWizardPage_Delimiter;
- public static String ParsingWizardPage_NumberOfColumns;
- public static String ParsingWizardPage_RegularExpression;
-
public static String SystemTapScriptGraphOptionsTab_0;
public static String SystemTapScriptGraphOptionsTab_1;
public static String SystemTapScriptGraphOptionsTab_2;
@@ -40,16 +35,26 @@ public class Messages extends NLS {
public static String SystemTapScriptGraphOptionsTab_EditGraphButton;
public static String SystemTapScriptGraphOptionsTab_EditGraphButtonToolTip;
+ public static String SystemTapScriptGraphOptionsTab_columnTitle;
public static String SystemTapScriptGraphOptionsTab_extractedValueLabel;
+ public static String SystemTapScriptGraphOptionsTab_defaultColumnTitleBase;
public static String SystemTapScriptGraphOptionsTab_RemoveGraphButton;
public static String SystemTapScriptGraphOptionsTab_RemoveGraphButtonToolTip;
- public static String SystemTapScriptGraphOptionsTab_graphsTitle;
+ public static String SystemTapScriptGraphOptionsTab_invalidGraph;
+ public static String SystemTapScriptGraphOptionsTab_regexLabel;
public static String SystemTapScriptGraphOptionsTab_regexTooltip;
+ public static String SystemTapScriptGraphOptionsTab_regexAddNew;
+ public static String SystemTapScriptGraphOptionsTab_regexRemove;
+ public static String SystemTapScriptGraphOptionsTab_graphSetTitleBase;
- public static String SystemTapScriptGraphOptionsTab_sampleOutputLabel;
+ public static String SystemTapScriptGraphOptionsTab_removeRegexTitle;
+ public static String SystemTapScriptGraphOptionsTab_removeRegexAsk;
+ public static String SystemTapScriptGraphOptionsTab_sampleOutputLabel;
public static String SystemTapScriptGraphOptionsTab_sampleOutputTooltip;
+ public static String SystemTapScriptGraphOptionsTab_sampleOutputNoMatch;
+ public static String SystemTapScriptGraphOptionsTab_sampleOutputIsEmpty;
public static String SystemTapScriptLaunchConfigurationTab_0;
public static String SystemTapScriptLaunchConfigurationTab_1;
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/launcher/SystemTapScriptGraphOptionsTab.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/launcher/SystemTapScriptGraphOptionsTab.java
index bc4542f..ed41426 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/launcher/SystemTapScriptGraphOptionsTab.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/launcher/SystemTapScriptGraphOptionsTab.java
@@ -12,6 +12,7 @@
package org.eclipse.linuxtools.internal.systemtap.ui.ide.launcher;
+import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
@@ -24,6 +25,7 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.linuxtools.internal.systemtap.ui.ide.IDEPlugin;
import org.eclipse.linuxtools.systemtap.graphingapi.core.datasets.IDataSet;
@@ -46,6 +48,7 @@ import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Group;
@@ -60,14 +63,23 @@ import org.eclipse.ui.plugin.AbstractUIPlugin;
public class SystemTapScriptGraphOptionsTab extends
AbstractLaunchConfigurationTab {
+ /**
+ * The maximum number of regular expressions that can be stored in a configuration.
+ */
+ static final int MAX_NUMBER_OF_REGEXS = 20;
+
+ // Note: any non-private String key with a trailing underscore is to be appended with an integer when looking up values.
static final String RUN_WITH_CHART = "runWithChart"; //$NON-NLS-1$
- static final String NUMBER_OF_COLUMNS = "numberOfColumns"; //$NON-NLS-1$
+ static final String NUMBER_OF_REGEXS = "numberOfRegexs"; //$NON-NLS-1$
+ static final String NUMBER_OF_COLUMNS = "numberOfColumns_"; //$NON-NLS-1$
static final String REGEX_BOX = "regexBox_"; //$NON-NLS-1$
- static final String NUMBER_OF_EXTRAS = "numberOfExtras"; //$NON-NLS-1$
+ static final String NUMBER_OF_EXTRAS = "numberOfExtras_"; //$NON-NLS-1$
static final String EXTRA_BOX = "extraBox_"; //$NON-NLS-1$
- static final String REGULARE_EXPRESSION = "regularExpression"; //$NON-NLS-1$
- static final String SAMPLE_OUTPUT = "sampleOutput"; //$NON-NLS-1$
+ static final String REGULAR_EXPRESSION = "regularExpression_"; //$NON-NLS-1$
+ static final String SAMPLE_OUTPUT = "sampleOutput_"; //$NON-NLS-1$
+ // Note: all graph-related keys point to 2D lists (regular expression & graph number),
+ // except for GRAPH_Y_SERIES (which is a 3D list).
private static final String NUMBER_OF_GRAPHS = "numberOfGraphs"; //$NON-NLS-1$
private static final String GRAPH_TITLE = "graphTitle"; //$NON-NLS-1$
private static final String GRAPH_KEY = "graphKey"; //$NON-NLS-1$
@@ -78,9 +90,26 @@ public class SystemTapScriptGraphOptionsTab extends
protected Pattern pattern;
protected Matcher matcher;
- private ModifyListener regExListener = new ModifyListener() {
+ private ModifyListener regexListener = new ModifyListener() {
@Override
public void modifyText(ModifyEvent event) {
+ if (!textListenersEnabled || regularExpressionCombo.getSelectionIndex() != -1) {
+ return;
+ }
+ regularExpressionCombo.setItem(selectedRegex, regularExpressionCombo.getText());
+ regularExpressionCombo.select(selectedRegex);
+ refreshRegexRows();
+ updateLaunchConfigurationDialog();
+ }
+ };
+
+ private ModifyListener sampleOutputListener = new ModifyListener() {
+ @Override
+ public void modifyText(ModifyEvent event) {
+ if (!textListenersEnabled) {
+ return;
+ }
+ outputList.set(selectedRegex, sampleOutputText.getText());
refreshRegexRows();
updateLaunchConfigurationDialog();
}
@@ -89,13 +118,32 @@ public class SystemTapScriptGraphOptionsTab extends
private ModifyListener columnNameListener = new ModifyListener() {
@Override
public void modifyText(ModifyEvent event) {
+ if (!textListenersEnabled) {
+ return;
+ }
+
+ ArrayList<String> columnNames = new ArrayList<String>();
+ Control[] children = textFieldsComposite.getChildren();
+ for (int i = 0; i < numberOfVisibleColumns; i++) {
+ columnNames.add(((Text)children[i*2]).getText());
+ }
+ columnNamesList.set(selectedRegex, columnNames);
updateLaunchConfigurationDialog();
}
};
- private Text regularExpressionText;
+ private Combo regularExpressionCombo;
+ private Button removeRegexButton;
+ private Text sampleOutputText;
private Composite textFieldsComposite;
+ /**
+ * This value controls whether or not the ModifyListeners associated with
+ * the Texts will perform when dispatched. Sometimes the listeners should
+ * be disabled to prevent needless/unsafe operations.
+ */
+ private boolean textListenersEnabled = true;
+
private ScrolledComposite regexTextScrolledComposite;
private Group outputParsingGroup;
private Button runWithChartCheckButton;
@@ -104,64 +152,190 @@ public class SystemTapScriptGraphOptionsTab extends
private Button addGraphButton, duplicateGraphButton, editGraphButton, removeGraphButton;
private TableItem selectedTableItem;
private Group graphsGroup;
- private Text sampleOutputText;
private int numberOfVisibleColumns = 0;
private boolean graphingEnabled = true;
- private String regexErrorMessage;
- private Stack<String> cachedNames = new Stack<String>();
- private List<TableItem> badGraphs = new LinkedList<TableItem>();
- private int oldNumColumns;
- private int oldNumExtras;
- public static IDataSetParser createDatasetParser(ILaunchConfiguration configuration) {
+ /**
+ * A list of error messages, each entry corresponding to an entered regular expression.
+ */
+ private List<String> regexErrorMessages = new ArrayList<String>();
+
+ /**
+ * The index of the selected regular expression.
+ */
+ private int selectedRegex = -1;
+
+ /**
+ * A list containing the user-defined sample outputs associated with the regex of every index.
+ */
+ private List<String> outputList = new ArrayList<String>();
+
+ /**
+ * A name is given to each group captured by a regular expression. This stack contains
+ * the names of all of a regex's groups that have been deleted, so each name may be
+ * restored (without having to retype it) when a group is added again.
+ */
+ private Stack<String> cachedNames;
+
+ /**
+ * A list of cachedNames stacks, containing one entry for each regular expression stored.
+ */
+ private List<Stack<String>> cachedNamesList = new ArrayList<Stack<String>>();
+
+ /**
+ * A two-dimensional list that holds references to the names given to each regular expression's captured groups.
+ */
+ private List<ArrayList<String>> columnNamesList = new ArrayList<ArrayList<String>>();
+
+ /**
+ * A list holding the data of every graph for the selected regular expression.
+ */
+ private List<GraphData> graphsData = new LinkedList<GraphData>();
+
+ /**
+ * A list of graphsData lists. This is needed because each regular expression has its own set of graphs.
+ */
+ private List<LinkedList<GraphData>> graphsDataList = new ArrayList<LinkedList<GraphData>>();
+
+ /**
+ * A list of GraphDatas that rely on series information that has been deleted from their relying regex.
+ */
+ private List<GraphData> badGraphs = new LinkedList<GraphData>();
+
+ /**
+ * Returns the list of the names given to reach regular expression.
+ * @param configuration
+ * @return
+ */
+ public static ArrayList<String> createDatasetNames(ILaunchConfiguration configuration) {
try {
- return new LineParser("^" + configuration.getAttribute(REGULARE_EXPRESSION, "") + "$"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ int numberOfRegexs = configuration.getAttribute(NUMBER_OF_REGEXS, 0);
+ ArrayList<String> names = new ArrayList<String>(numberOfRegexs);
+ for (int r = 0; r < numberOfRegexs; r++) {
+ names.add(MessageFormat.format(Messages.SystemTapScriptGraphOptionsTab_graphSetTitleBase, r + 1));
+ }
+ return names;
} catch (CoreException e) {
ExceptionErrorDialog.openError(Messages.SystemTapScriptGraphOptionsTab_0, e);
}
return null;
}
- public static IDataSet createDataset(ILaunchConfiguration configuration) {
- int n;
+ /**
+ * Creates a list of parsers, one for each regular expression created, that will be used
+ * to parse the output of a running script.
+ * @param configuration The desired run configuration.
+ * @return A list of parsers.
+ */
+ public static ArrayList<IDataSetParser> createDatasetParsers(ILaunchConfiguration configuration) {
try {
- n = configuration.getAttribute(NUMBER_OF_COLUMNS, 0);
- ArrayList<String> labels = new ArrayList<String>(n);
+ int numberOfRegexs = configuration.getAttribute(NUMBER_OF_REGEXS, 0);
+ ArrayList<IDataSetParser> parsers = new ArrayList<IDataSetParser>(numberOfRegexs);
+ for (int r = 0; r < numberOfRegexs; r++) {
+ parsers.add(new LineParser("^" + configuration.getAttribute(REGULAR_EXPRESSION + r, "") + "$")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+ return parsers;
+ } catch (CoreException e) {
+ ExceptionErrorDialog.openError(Messages.SystemTapScriptGraphOptionsTab_0, e);
+ }
+ return null;
+ }
- for (int i = 0; i < n; i++) {
- String text = configuration.getAttribute(REGEX_BOX + i, (String) null);
- labels.add(text);
+ /**
+ * Creates a data set corresponding to the titles given to each output column
+ * from each of a run configuration's regular expressions.
+ * @param configuration
+ * @return
+ */
+ public static ArrayList<IDataSet> createDataset(ILaunchConfiguration configuration) {
+ try {
+ int numberOfRegexs = configuration.getAttribute(NUMBER_OF_REGEXS, 0);
+ ArrayList<IDataSet> datasets = new ArrayList<IDataSet>(numberOfRegexs);
+
+ for (int r = 0; r < numberOfRegexs; r++) {
+ int numberOfColumns = configuration.getAttribute(NUMBER_OF_COLUMNS + r, 0);
+ ArrayList<String> labels = new ArrayList<String>(numberOfColumns);
+
+ for (int c = 0; c < numberOfColumns; c++) {
+ labels.add(configuration.getAttribute(get2DConfigData(REGEX_BOX, r, c), "")); //$NON-NLS-1$
+ }
+ datasets.add(DataSetFactory.createDataSet(RowDataSet.ID, labels.toArray(new String[] {})));
}
- return DataSetFactory.createDataSet(RowDataSet.ID, labels.toArray(new String[] {}));
+ return datasets;
} catch (CoreException e) {
ExceptionErrorDialog.openError(Messages.SystemTapScriptGraphOptionsTab_1, e);
}
return null;
}
- public static LinkedList<GraphData> createGraphsFromConfiguration (ILaunchConfiguration configuration) throws CoreException {
- LinkedList<GraphData> graphs = new LinkedList<GraphData>();
- int n = configuration.getAttribute(NUMBER_OF_GRAPHS, 0);
- for (int i = 0; i < n; i++) {
- GraphData graphData = new GraphData();
- graphData.title = configuration.getAttribute (GRAPH_TITLE + i, ""); //$NON-NLS-1$
-
- graphData.key = configuration.getAttribute(GRAPH_KEY + i, ""); //$NON-NLS-1$
- graphData.xSeries = configuration.getAttribute(GRAPH_X_SERIES + i, 0);
- graphData.graphID = configuration.getAttribute(GRAPH_ID + i, ""); //$NON-NLS-1$
+ /**
+ * Creates graph data corresponding to the graphs that will plot a script's parsed output data.
+ * @param configuration The desired run configuration.
+ * @return A data set.
+ */
+ public static ArrayList<LinkedList<GraphData>> createGraphsFromConfiguration (ILaunchConfiguration configuration)
+ throws CoreException {
+ // Restrict number of regexs to at least one, so at least
+ // one inner list will exist in the return value.
+ int numberOfRegexs = Math.max(configuration.getAttribute(NUMBER_OF_REGEXS, 1), 1);
+ ArrayList<LinkedList<GraphData>> graphsList = new ArrayList<LinkedList<GraphData>>(numberOfRegexs);
+
+ for (int r = 0; r < numberOfRegexs; r++) {
+ int numberOfGraphs = configuration.getAttribute(NUMBER_OF_GRAPHS + r, 0);
+ LinkedList<GraphData> graphs = new LinkedList<GraphData>();
+ for (int i = 0; i < numberOfGraphs; i++) {
+ GraphData graphData = new GraphData();
+ graphData.title = configuration.getAttribute(get2DConfigData(GRAPH_TITLE, r, i), (String) null);
+
+ graphData.key = configuration.getAttribute(get2DConfigData(GRAPH_KEY, r, i), (String) null);
+ graphData.xSeries = configuration.getAttribute(get2DConfigData(GRAPH_X_SERIES, r, i), 0);
+ graphData.graphID = configuration.getAttribute(get2DConfigData(GRAPH_ID, r, i), (String) null);
+
+ int ySeriesLength = configuration.getAttribute(get2DConfigData(GRAPH_Y_SERIES_LENGTH, r, i), 0);
+ if (ySeriesLength == 0) {
+ graphData.ySeries = null;
+ } else {
+ int[] ySeries = new int[ySeriesLength];
+ for (int j = 0; j < ySeriesLength; j++) {
+ ySeries[j] = configuration.getAttribute(get2DConfigData(GRAPH_Y_SERIES, r, i + "_" + j), 0); //$NON-NLS-1$
+ }
+ graphData.ySeries = ySeries;
+ }
- int ySeriesLength = configuration.getAttribute(GRAPH_Y_SERIES_LENGTH + i, 0);
- int[] ySeries = new int[ySeriesLength];
- for (int j = 0; j < ySeriesLength; j++) {
- ySeries[j] = configuration.getAttribute(GRAPH_Y_SERIES + i + "_" + j, 0); //$NON-NLS-1$
+ graphs.add(graphData);
}
- graphData.ySeries = ySeries;
-
- graphs.add(graphData);
+ graphsList.add(graphs);
}
- return graphs;
+ return graphsList;
+ }
+
+ /**
+ * Returns the key associated with the i'th data item of the r'th regular expression.
+ * @param configDataName The type of data to access from the configuration.
+ * @param r The index of the regular expression.
+ * @param i The index of the data item to access.
+ */
+ private static String get2DConfigData(String configDataName, int r, int i) {
+ return configDataName + r + "_" + i; //$NON-NLS-1$
+ }
+
+ /**
+ * Returns the key associated with the data item of the r'th regular expression, tagged by string s.
+ * @param configDataName The type of data to access from the configuration.
+ * @param r The index of the regular expression.
+ * @param s The string to put at the end of the key.
+ */
+ private static String get2DConfigData(String configDataName, int r, String s) {
+ return configDataName + r + "_" + s; //$NON-NLS-1$
+ }
+
+ /**
+ * Returns the total number of regular expressions of the current configuration.
+ */
+ private int getNumberOfRegexs() {
+ return outputList.size();
}
@Override
@@ -194,7 +368,6 @@ public class SystemTapScriptGraphOptionsTab extends
this.createColumnSelector(outputParsingGroup);
this.graphsGroup = new Group(top, SWT.SHADOW_ETCHED_IN);
- graphsGroup.setText(Messages.SystemTapScriptGraphOptionsTab_graphsTitle);
graphsGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
createGraphCreateArea(graphsGroup);
@@ -210,42 +383,118 @@ public class SystemTapScriptGraphOptionsTab extends
GridLayout twoColumns = new GridLayout();
twoColumns.numColumns = 2;
+ GridLayout threeColumns = new GridLayout();
+ threeColumns.numColumns = 3;
+
+ Composite regexButtonLayout = new Composite(parent, SWT.NONE);
+ regexButtonLayout.setLayout(threeColumns);
+ regexButtonLayout.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+
+ Label selectedRegexLabel = new Label(regexButtonLayout, SWT.NONE);
+ selectedRegexLabel.setText(Messages.SystemTapScriptGraphOptionsTab_regexLabel);
+ selectedRegexLabel.setToolTipText(Messages.SystemTapScriptGraphOptionsTab_regexTooltip);
+ regularExpressionCombo = new Combo(regexButtonLayout, SWT.DROP_DOWN);
+ regularExpressionCombo.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+ regularExpressionCombo.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ int selected = regularExpressionCombo.getSelectionIndex();
+ if (selected == selectedRegex) {
+ return;
+ }
+
+ // If deselecting an empty regular expression, delete it automatically.
+ if (regularExpressionCombo.getItem(selectedRegex).equals("") //$NON-NLS-1$
+ && graphsDataList.get(selectedRegex).size() == 0
+ && outputList.get(selectedRegex).equals("")) { //$NON-NLS-1$
+
+ // If the deselected regex is the last one in the combo, just quit.
+ // Otherwise, the deleted blank entry would be replaced by another blank entry.
+ if (selected == regularExpressionCombo.getItemCount() - 1) {
+ regularExpressionCombo.select(selectedRegex); // To keep the text blank.
+ return;
+ }
+ removeRegex(false);
+ if (selected > selectedRegex) {
+ selected--;
+ }
+ }
+
+ // When selecting the "Add New Regex" item in the combo (which is always the last item),
+ // update all appropriate values to make room for a new regular expression.
+ if (selected == regularExpressionCombo.getItemCount() - 1 && getNumberOfRegexs() < MAX_NUMBER_OF_REGEXS) {
+ outputList.add(""); //$NON-NLS-1$
+ regexErrorMessages.add(null);
+ columnNamesList.add(new ArrayList<String>());
+ cachedNamesList.add(new Stack<String>());
+ graphsDataList.add(new LinkedList<GraphData>());
+
+ // Remove "Add New Regex" from the selected combo item; make it blank.
+ regularExpressionCombo.setItem(selected, ""); //$NON-NLS-1$
+ regularExpressionCombo.select(selected);
+ updateRegexSelection(selected, false);
+ updateLaunchConfigurationDialog();
+
+ // Enable the "remove" button if only one item was present before.
+ // (Don't do this _every_ time something is added.)
+ if (getNumberOfRegexs() == 2) {
+ removeRegexButton.setEnabled(true);
+ }
+ if (getNumberOfRegexs() < MAX_NUMBER_OF_REGEXS) {
+ regularExpressionCombo.add(Messages.SystemTapScriptGraphOptionsTab_regexAddNew);
+ }
+ } else {
+ updateRegexSelection(selected, false);
+ }
+ }
+ });
+ regularExpressionCombo.addModifyListener(regexListener);
+
+ removeRegexButton = new Button(regexButtonLayout, SWT.PUSH);
+ removeRegexButton.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false));
+ removeRegexButton.setText(Messages.SystemTapScriptGraphOptionsTab_regexRemove);
+ removeRegexButton.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ IWorkbench workbench = PlatformUI.getWorkbench();
+ MessageDialog dialog = new MessageDialog(workbench
+ .getActiveWorkbenchWindow().getShell(), Messages.SystemTapScriptGraphOptionsTab_removeRegexTitle, null,
+ MessageFormat.format(Messages.SystemTapScriptGraphOptionsTab_removeRegexAsk,
+ regularExpressionCombo.getItem(selectedRegex)),
+ MessageDialog.QUESTION, new String[]{"Yes", "No"}, 0); //$NON-NLS-1$ //$NON-NLS-2$
+ int result = dialog.open();
+ if (result == 0) { //Yes
+ removeRegex(true);
+ }
+ }
+ });
+
Composite regexSummaryComposite = new Composite(parent, SWT.NONE);
regexSummaryComposite.setLayout(twoColumns);
regexSummaryComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- Label regularExpressionLabel = new Label(regexSummaryComposite, SWT.NONE);
- regularExpressionLabel.setText(Messages.ParsingWizardPage_RegularExpression + ":"); //$NON-NLS-1$
- regularExpressionLabel.setToolTipText(Messages.SystemTapScriptGraphOptionsTab_regexTooltip);
- regularExpressionText = new Text(regexSummaryComposite, SWT.BORDER);
- regularExpressionText.setToolTipText(Messages.SystemTapScriptGraphOptionsTab_regexTooltip);
- regularExpressionText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- regularExpressionText.addModifyListener(regExListener);
-
Label sampleOutputLabel = new Label(regexSummaryComposite, SWT.NONE);
sampleOutputLabel.setText(Messages.SystemTapScriptGraphOptionsTab_sampleOutputLabel);
sampleOutputLabel.setToolTipText(Messages.SystemTapScriptGraphOptionsTab_sampleOutputTooltip);
this.sampleOutputText = new Text(regexSummaryComposite, SWT.BORDER);
this.sampleOutputText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- this.sampleOutputText.addModifyListener(regExListener);
+ this.sampleOutputText.addModifyListener(sampleOutputListener);
sampleOutputText.setToolTipText(Messages.SystemTapScriptGraphOptionsTab_sampleOutputTooltip);
- GridLayout threeColumnLayout = new GridLayout();
- threeColumnLayout.numColumns = 3;
- threeColumnLayout.makeColumnsEqualWidth = true;
Composite expressionTableLabels = new Composite(parent, SWT.NONE);
- expressionTableLabels.setLayout(threeColumnLayout);
+ expressionTableLabels.setLayout(twoColumns);
expressionTableLabels.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
Label label = new Label(expressionTableLabels, SWT.NONE);
- label.setText(Messages.ParsingWizardPage_Title);
- label.setAlignment(SWT.CENTER);
+ label.setText(Messages.SystemTapScriptGraphOptionsTab_columnTitle);
+ label.setAlignment(SWT.LEFT);
GridData data = new GridData(SWT.FILL, SWT.FILL, false, false);
data.widthHint = 200;
label.setLayoutData(data);
label = new Label(expressionTableLabels, SWT.NONE);
+ label.setAlignment(SWT.CENTER);
label.setText(Messages.SystemTapScriptGraphOptionsTab_extractedValueLabel);
label.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
@@ -260,20 +509,10 @@ public class SystemTapScriptGraphOptionsTab extends
regexTextScrolledComposite.setContent(textFieldsComposite);
regexTextScrolledComposite.setExpandHorizontal(true);
regexTextScrolledComposite.setExpandVertical(false);
-
- refreshRegexRows();
}
- private IDataSet getDataset() {
- Control[] textBoxes = this.textFieldsComposite.getChildren();
- int numberOfColumns = textBoxes.length/2;
- ArrayList<String> labels = new ArrayList<String>(numberOfColumns);
-
- for (int i = 0; i < numberOfColumns; i++) {
- String text = ((Text)textBoxes[i*2]).getText();
- labels.add(text);
- }
- return DataSetFactory.createDataSet(RowDataSet.ID, labels.toArray(new String[] {}));
+ private IDataSet getCurrentDataset() {
+ return DataSetFactory.createDataSet(RowDataSet.ID, columnNamesList.get(selectedRegex).toArray(new String[] {}));
}
private void createGraphCreateArea(Composite comp){
@@ -332,7 +571,7 @@ public class SystemTapScriptGraphOptionsTab extends
addGraphButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
- SelectGraphAndSeriesWizard wizard = new SelectGraphAndSeriesWizard(getDataset(), null);
+ SelectGraphAndSeriesWizard wizard = new SelectGraphAndSeriesWizard(getCurrentDataset(), null);
IWorkbench workbench = PlatformUI.getWorkbench();
wizard.init(workbench, null);
WizardDialog dialog = new WizardDialog(workbench
@@ -344,9 +583,8 @@ public class SystemTapScriptGraphOptionsTab extends
if (null != gd) {
TableItem item = new TableItem(graphsTable, SWT.NONE);
- item.setText(GraphFactory.getGraphName(gd.graphID) + ":" //$NON-NLS-1$
- + gd.title);
- item.setData(gd);
+ graphsData.add(gd);
+ setUpGraphTableItem(item, gd, false);
updateLaunchConfigurationDialog();
}
}
@@ -356,15 +594,15 @@ public class SystemTapScriptGraphOptionsTab extends
duplicateGraphButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
- GraphData gd = (GraphData) selectedTableItem.getData();
+ GraphData gd = ((GraphData) selectedTableItem.getData()).getCopy();
TableItem item = new TableItem(graphsTable, SWT.NONE);
- item.setText(GraphFactory.getGraphName(gd.graphID) + ":" //$NON-NLS-1$
- + gd.title);
- item.setData(gd);
- if (badGraphs.contains(selectedTableItem)) {
- badGraphs.add(item);
- markGraphTableItem(item, true);
+ graphsData.add(gd);
+ if (badGraphs.contains(selectedTableItem.getData())) {
+ badGraphs.add(gd);
+ setUpGraphTableItem(item, gd, true);
+ } else {
+ setUpGraphTableItem(item, gd, false);
}
updateLaunchConfigurationDialog();
}
@@ -376,7 +614,7 @@ public class SystemTapScriptGraphOptionsTab extends
editGraphButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
- SelectGraphAndSeriesWizard wizard = new SelectGraphAndSeriesWizard(getDataset(),
+ SelectGraphAndSeriesWizard wizard = new SelectGraphAndSeriesWizard(getCurrentDataset(),
(GraphData) selectedTableItem.getData());
IWorkbench workbench = PlatformUI.getWorkbench();
wizard.init(workbench, null);
@@ -386,14 +624,14 @@ public class SystemTapScriptGraphOptionsTab extends
dialog.open();
GraphData gd = wizard.getGraphData();
-
- if (null != gd) {
- selectedTableItem.setText(GraphFactory.getGraphName(gd.graphID) + ":" //$NON-NLS-1$
- + gd.title);
- selectedTableItem.setData(gd);
- if (badGraphs.contains(selectedTableItem)){
- findBadGraphs(selectedTableItem);
- }
+ if (null == gd) {
+ return;
+ }
+ GraphData old_gd = (GraphData) selectedTableItem.getData();
+ if (!gd.equals(old_gd)) {
+ badGraphs.remove(old_gd);
+ setUpGraphTableItem(selectedTableItem, gd, false);
+ graphsData.set(graphsTable.indexOf(selectedTableItem), gd);
updateLaunchConfigurationDialog();
}
}
@@ -403,7 +641,9 @@ public class SystemTapScriptGraphOptionsTab extends
removeGraphButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
- badGraphs.remove(selectedTableItem);
+ GraphData gd = (GraphData) selectedTableItem.getData();
+ graphsData.remove(gd);
+ badGraphs.remove(gd);
selectedTableItem.dispose();
setSelectionControlsEnabled(false);
updateLaunchConfigurationDialog();
@@ -411,117 +651,284 @@ public class SystemTapScriptGraphOptionsTab extends
});
}
+ private void removeRegex(boolean autoSelect) {
+ int removedRegex = selectedRegex;
+ if (autoSelect) {
+ // The current selection is to be removed, so select something else that will be available.
+ regularExpressionCombo.select(selectedRegex != 0 ? selectedRegex - 1 : 1);
+ updateRegexSelection(regularExpressionCombo.getSelectionIndex(), false);
+ }
+
+ regularExpressionCombo.remove(removedRegex);
+ outputList.remove(removedRegex);
+ regexErrorMessages.remove(removedRegex);
+ columnNamesList.remove(removedRegex);
+ cachedNamesList.remove(removedRegex);
+ graphsDataList.remove(removedRegex);
+
+ if (autoSelect) {
+ // Make sure the index of the selection is accurate.
+ selectedRegex = regularExpressionCombo.getSelectionIndex();
+ }
+
+ // Re-add the "Add New Regex" entry if it is missing.
+ if (getNumberOfRegexs() == MAX_NUMBER_OF_REGEXS - 1) {
+ regularExpressionCombo.add(Messages.SystemTapScriptGraphOptionsTab_regexAddNew);
+ }
+
+ // Disable the "remove" button if only one selection is left; never want zero items.
+ if (getNumberOfRegexs() == 1) {
+ removeRegexButton.setEnabled(false);
+ }
+ updateLaunchConfigurationDialog();
+ }
+
+ /**
+ * This handles UI & list updating whenever a different regular expression is selected.
+ * @param newSelection The index of the regex to be selected.
+ * @param force If true, the UI will update even if the index of the selected regex did not change.
+ */
+ private void updateRegexSelection(int newSelection, boolean force) {
+ // Quit if the selection didn't change anything, or if the selection is invalid (-1).
+ if (newSelection == -1 || (!force && selectedRegex == newSelection)) {
+ return;
+ }
+ selectedRegex = newSelection;
+
+ boolean textListenersDisabled = !textListenersEnabled;
+ if (!textListenersDisabled)
+ textListenersEnabled = false;
+
+ sampleOutputText.setText(outputList.get(selectedRegex));
+ cachedNames = cachedNamesList.get(selectedRegex);
+
+ // Update the number of columns and their titles here, and not in refreshRegexRows,
+ // using the list of saved active names instead of a cachedNames stack.
+ ArrayList<String> columnNames = columnNamesList.get(selectedRegex);
+ int desiredNumberOfColumns = columnNames.size();
+ // Remove all columns to easily update them all immediately afterwards.
+ while (numberOfVisibleColumns > 0) {
+ removeColumn(false);
+ }
+ while (numberOfVisibleColumns < desiredNumberOfColumns) {
+ addColumn(columnNames.get(numberOfVisibleColumns));
+ }
+
+ refreshRegexRows();
+
+ // Now, only display graphs that are associated with the selected regex.
+ graphsData = graphsDataList.get(selectedRegex);
+ graphsTable.removeAll();
+ selectedTableItem = null;
+ setSelectionControlsEnabled(false);
+
+ for (GraphData gd : graphsData) {
+ TableItem item = new TableItem(graphsTable, SWT.NONE);
+ setUpGraphTableItem(item, gd, badGraphs.contains(gd));
+ }
+ graphsGroup.setText(MessageFormat.format(Messages.SystemTapScriptGraphOptionsTab_graphSetTitleBase,
+ selectedRegex + 1));
+
+ if (!textListenersDisabled)
+ textListenersEnabled = true;
+ }
+
private void refreshRegexRows() {
try{
- pattern = Pattern.compile(regularExpressionText.getText());
+ pattern = Pattern.compile(regularExpressionCombo.getText());
matcher = pattern.matcher(sampleOutputText.getText());
- this.regexErrorMessage = ""; //$NON-NLS-1$
+ regexErrorMessages.set(selectedRegex, null);
}catch (PatternSyntaxException e){
- this.regexErrorMessage = e.getMessage();
+ regexErrorMessages.set(selectedRegex, e.getMessage());
return;
}
- if (regularExpressionText.getText().contains("()")){ //$NON-NLS-1$
- this.regexErrorMessage = Messages.SystemTapScriptGraphOptionsTab_6;
+ regexErrorMessages.set(selectedRegex, checkRegex(regularExpressionCombo.getText()));
+ if (regexErrorMessages.get(selectedRegex) != null) {
return;
}
- int desiredNumberOfColumns = matcher.groupCount();
+ int desiredNumberOfColumns = matcher.groupCount();
while (numberOfVisibleColumns < desiredNumberOfColumns){
- addColumn();
+ addColumn(null);
}
while (numberOfVisibleColumns > desiredNumberOfColumns){
- removeColumn();
+ removeColumn(true);
}
// Set values
Control[] children = textFieldsComposite.getChildren();
for (int i = 0; i < numberOfVisibleColumns; i++) {
- if (!matcher.matches()){
- ((Label)children[i*2+1]).setText(""); //$NON-NLS-1$
+ String sampleOutputResults;
+ if (matcher.matches()) {
+ sampleOutputResults = matcher.group(i+1);
+ }
+ else if (sampleOutputText.getText().length() == 0){
+ sampleOutputResults = Messages.SystemTapScriptGraphOptionsTab_sampleOutputIsEmpty;
} else {
- ((Label)children[i*2+1]).setText(" " +matcher.group(i+1)); //$NON-NLS-1$
+ sampleOutputResults = Messages.SystemTapScriptGraphOptionsTab_sampleOutputNoMatch;
}
+ ((Label)children[i*2+1]).setText(" " + sampleOutputResults); //$NON-NLS-1$
}
+ // May only add/edit graphs if there is output data being captured.
+ addGraphButton.setEnabled(numberOfVisibleColumns > 0);
+ if (selectedTableItem != null) {
+ editGraphButton.setEnabled(numberOfVisibleColumns > 0);
+ }
+
+ regexErrorMessages.set(selectedRegex, findBadGraphs(selectedRegex));
+ }
+
+ /**
+ * Checks if a provided regular expression is valid.
+ * @param regex The regular expression to check for validity.
+ * @return <code>null</code> if the regular expression is valid, or an error message.
+ */
+ private String checkRegex(String regex) {
+ //TODO may add more invalid regexs here, each with its own error message.
+ if (regex.contains("()")){ //$NON-NLS-1$
+ return Messages.SystemTapScriptGraphOptionsTab_6;
+ }
+ return null;
}
- private void addColumn(){
+ /**
+ * Adds one column to the list of the currently-selected regex's columns.
+ * This creates an extra Text in which the name of the column may be entered,
+ * and a corresponding Label containing sample expected output.
+ * @param nameToAdd If non-null, the name of the newly-created column will
+ * match this String. If null, the column will be given a name recovered from
+ * the active stack of cached names, or a default name if one doesn't exist.
+ */
+ private void addColumn(String nameToAdd) {
Text text = new Text(textFieldsComposite, SWT.BORDER);
GridData data = new GridData(SWT.FILL, SWT.FILL, false, false);
data.minimumWidth = 200;
data.widthHint = 200;
text.setLayoutData(data);
- if (cachedNames.size() > 0) {
- text.setText(cachedNames.pop());
- }
+
+ numberOfVisibleColumns++;
text.addModifyListener(columnNameListener);
+ if (nameToAdd == null) {
+ // Restore a deleted name by popping from the stack.
+ if (cachedNames.size() > 0) {
+ text.setText(cachedNames.pop());
+ } else {
+ text.setText(MessageFormat.format(Messages.SystemTapScriptGraphOptionsTab_defaultColumnTitleBase,
+ numberOfVisibleColumns));
+ }
+ } else {
+ text.setText(nameToAdd);
+ }
Label label = new Label(textFieldsComposite, SWT.BORDER);
label.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
- this.numberOfVisibleColumns++;
- findBadGraphs();
-
textFieldsComposite.layout();
textFieldsComposite.pack();
}
- private void removeColumn(){
+ /**
+ * Removes a column from the currently-selected regex, and removes its
+ * corresponding Text & Label from the UI.
+ * @param saveNames Set to <code>true</code> if the contents of removed
+ * columns are to be saved in a stack for later use.
+ */
+ private void removeColumn(Boolean saveNames) {
Control[] children = textFieldsComposite.getChildren();
int i = this.numberOfVisibleColumns*2 -1;
- cachedNames.push(((Text)children[i-1]).getText());
+
+ if (saveNames) {
+ // Push the removed name on a stack.
+ String name = ((Text)children[i-1]).getText();
+ if (name != null && name != "") { //$NON-NLS-1$
+ cachedNames.push(name);
+ }
+ columnNamesList.get(selectedRegex).remove(numberOfVisibleColumns - 1);
+ }
+
children[i].dispose();
children[i-1].dispose();
this.numberOfVisibleColumns--;
- findBadGraphs();
textFieldsComposite.layout();
textFieldsComposite.pack();
}
- private void findBadGraphs(){
- findBadGraphs(null);
- }
-
- private void findBadGraphs(TableItem itemToCheck){
- TableItem[] items = {itemToCheck};
- if (itemToCheck == null) {
- items = graphsTable.getItems();
- }
- if (items.length == 0){
- badGraphs.clear();
- return;
- }
- for (TableItem item : items){
- GraphData gd = (GraphData) item.getData();
+ /**
+ * Marks all graphs belonging to the indicated regular expression that are
+ * missing column data, or unmarks graphs that aren't missing data.
+ * @param regex The index of the regular expression to check for invalid graphs.
+ * @return An appropriate error message if an invalid graph is found, or if the
+ * selected regular expression parses nothing.
+ */
+ private String findBadGraphs(int regex) {
+ boolean foundBad = false;
+ int numberOfColumns = columnNamesList.get(regex).size();
+ for (GraphData gd : graphsDataList.get(regex)) {
boolean removed = false;
- if (gd.xSeries >= this.numberOfVisibleColumns){
+ if (gd.xSeries >= numberOfColumns) {
removed = true;
}
- for (int s = 0; s < gd.ySeries.length && !removed; s++){
- if (gd.ySeries[s] >= this.numberOfVisibleColumns){
+ for (int s = 0; s < gd.ySeries.length && !removed; s++) {
+ if (gd.ySeries[s] >= numberOfColumns) {
removed = true;
}
}
-
- if (removed){
- if (!badGraphs.contains(item)){
- badGraphs.add(item);
- markGraphTableItem(item, true);
+ if (removed) {
+ foundBad = true;
+ if (!badGraphs.contains(gd)) {
+ badGraphs.add(gd);
+ setUpGraphTableItem(findGraphTableItem(gd), null, true);
}
- }else if (badGraphs.contains(item)){
- badGraphs.remove(item);
- markGraphTableItem(item, false);
+ } else if (badGraphs.contains(gd)) {
+ badGraphs.remove(gd);
+ setUpGraphTableItem(findGraphTableItem(gd), null, false);
}
}
+ if (numberOfColumns == 0) {
+ return Messages.SystemTapScriptGraphOptionsTab_9;
+ }
+ if (foundBad) {
+ return Messages.SystemTapScriptGraphOptionsTab_8;
+ }
+ return null;
}
- private void markGraphTableItem(TableItem item, boolean bad){
+ private TableItem findGraphTableItem(GraphData gd) {
+ for (TableItem item : graphsTable.getItems()) {
+ if (item.getData().equals(gd)) {
+ return item;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Sets up a given {@link TableItem} with the proper title & appearance based on
+ * its graph data & (in)valid status.
+ * @param item The {@link TableItem} to set up.
+ * @param gd The {@link GraphData} that the item will hold. Set to <code>null</code>
+ * to preserve the item's existing data.
+ * @param bad <code>true</code> if the item should appear as invalid, <code>false</code> otherwise.
+ */
+ private void setUpGraphTableItem(TableItem item, GraphData gd, boolean bad) {
+ // Include a null check to avoid accidentally marking non-visible items.
+ if (item == null) {
+ return;
+ }
+ if (gd != null) {
+ item.setData(gd);
+ } else {
+ gd = (GraphData) item.getData();
+ }
item.setForeground(item.getDisplay().getSystemColor(bad ? SWT.COLOR_RED : SWT.COLOR_BLACK));
+ item.setText(GraphFactory.getGraphName(gd.graphID) + ":" + gd.title //$NON-NLS-1$
+ + (bad ? " " + Messages.SystemTapScriptGraphOptionsTab_invalidGraph : "")); //$NON-NLS-1$ //$NON-NLS-2$
}
public boolean canFlipToNextPage() {
@@ -531,54 +938,85 @@ public class SystemTapScriptGraphOptionsTab extends
@Override
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
configuration.setAttribute(RUN_WITH_CHART, false);
- configuration.setAttribute(NUMBER_OF_COLUMNS, 0);
- configuration.setAttribute(NUMBER_OF_GRAPHS, 0);
- configuration.setAttribute(NUMBER_OF_GRAPHS, 0);
- configuration.setAttribute(REGULARE_EXPRESSION, ""); //$NON-NLS-1$
- configuration.setAttribute(SAMPLE_OUTPUT, ""); //$NON-NLS-1$
+ configuration.setAttribute(NUMBER_OF_REGEXS, 1);
+ configuration.setAttribute(NUMBER_OF_COLUMNS + 0, 0);
+ configuration.setAttribute(NUMBER_OF_EXTRAS + 0, 0);
+ configuration.setAttribute(REGULAR_EXPRESSION + 0, ""); //$NON-NLS-1$
+ configuration.setAttribute(SAMPLE_OUTPUT + 0, ""); //$NON-NLS-1$
+ configuration.setAttribute(NUMBER_OF_GRAPHS + 0, 0);
}
@Override
public void initializeFrom(ILaunchConfiguration configuration) {
try {
+ textListenersEnabled = false;
+
boolean chart = configuration.getAttribute(RUN_WITH_CHART, false);
setGraphingEnabled(chart);
this.runWithChartCheckButton.setSelection(chart);
- regularExpressionText.setText(configuration.getAttribute(REGULARE_EXPRESSION, "")); //$NON-NLS-1$
- sampleOutputText.setText(configuration.getAttribute(SAMPLE_OUTPUT, "")); //$NON-NLS-1$
+ // Reset lists & settings to keep things idempotent.
+ regularExpressionCombo.removeAll();
+ outputList.clear();
+ regexErrorMessages.clear();
+ columnNamesList.clear();
+ cachedNamesList.clear();
+ graphsTable.removeAll();
+ badGraphs.clear();
+
+ // There should always be at least one regular expression (a blank one still counts).
+ // If configuration's number of regexs is zero, it is outdated.
+ int numberOfRegexs = Math.max(configuration.getAttribute(NUMBER_OF_REGEXS, 1), 1);
- oldNumColumns = configuration.getAttribute(NUMBER_OF_COLUMNS, 0);
- Control[] textBoxes = this.textFieldsComposite.getChildren();
+ // Only allow removing regexs if there are more than one.
+ removeRegexButton.setEnabled(numberOfRegexs > 1);
- for (int i = 0; i < oldNumColumns && i*2 < textBoxes.length; i++) {
- String text = configuration.getAttribute(REGEX_BOX+i, (String)null);
- if (text != null) {
- ((Text)textBoxes[i*2]).setText(text);
+ for (int r = 0; r < numberOfRegexs; r++) {
+ // Save all of the configuration's regular expressions & sample outputs in a list.
+ regularExpressionCombo.add(configuration.getAttribute(REGULAR_EXPRESSION + r, "")); //$NON-NLS-1$
+ outputList.add(configuration.getAttribute(SAMPLE_OUTPUT + r, "")); //$NON-NLS-1$
+
+ // Save each regex's list of group names.
+ int numberOfColumns = configuration.getAttribute(NUMBER_OF_COLUMNS + r, 0);
+ ArrayList<String> namelist = new ArrayList<String>(numberOfColumns);
+ for (int i = 0; i < numberOfColumns; i++) {
+ namelist.add(configuration.getAttribute(get2DConfigData(REGEX_BOX, r, i), (String)null));
}
- }
+ columnNamesList.add(namelist);
+
+ //Reclaim missing column data that was required for existing graphs at the time of the previous "apply".
+ int numberOfExtras = configuration.getAttribute(NUMBER_OF_EXTRAS + r, 0);
+ Stack<String> oldnames = new Stack<String>();
+ for (int i = 0; i < numberOfExtras; i++) {
+ oldnames.push(configuration.getAttribute(get2DConfigData(EXTRA_BOX, r, i), (String)null));
+ }
+ cachedNamesList.add(oldnames);
- cachedNames.clear();
- oldNumExtras = configuration.getAttribute(NUMBER_OF_EXTRAS, 0);
- for (int i = oldNumExtras-1; i >= 0; i--) {
- cachedNames.push(configuration.getAttribute(EXTRA_BOX+i, "")); //$NON-NLS-1$
+ regexErrorMessages.add(null);
+ }
+ if (getNumberOfRegexs() < MAX_NUMBER_OF_REGEXS) {
+ regularExpressionCombo.add(Messages.SystemTapScriptGraphOptionsTab_regexAddNew);
}
+ // When possible, preserve the selection on subsequent initializations, for user convenience.
+ int defaultSelectedRegex = 0 <= selectedRegex && selectedRegex < numberOfRegexs ? selectedRegex : 0;
+ regularExpressionCombo.select(defaultSelectedRegex);
+
// Add graphs
- graphsTable.removeAll();
- badGraphs.clear();
- LinkedList<GraphData> graphs = createGraphsFromConfiguration(configuration);
- for (GraphData graphData : graphs) {
+ graphsDataList = createGraphsFromConfiguration(configuration);
+ graphsData = graphsDataList.get(defaultSelectedRegex);
+ for (GraphData graphData : graphsData) {
TableItem item = new TableItem(graphsTable, SWT.NONE);
- item.setText(GraphFactory.getGraphName(graphData.graphID) + ":" //$NON-NLS-1$
- + graphData.title);
- item.setForeground(item.getDisplay().getSystemColor(SWT.COLOR_BLACK));
- item.setData(graphData);
- findBadGraphs(item);
+ setUpGraphTableItem(item, graphData, true);
}
+ updateRegexSelection(0, true); // Handles all remaining updates.
+ checkAllOtherErrors();
+
} catch (CoreException e) {
ExceptionErrorDialog.openError(Messages.SystemTapScriptGraphOptionsTab_5, e);
+ } finally {
+ textListenersEnabled = true;
}
}
@@ -586,51 +1024,134 @@ public class SystemTapScriptGraphOptionsTab extends
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
configuration.setAttribute(RUN_WITH_CHART, this.runWithChartCheckButton.getSelection());
- configuration.setAttribute(REGULARE_EXPRESSION, regularExpressionText.getText());
- configuration.setAttribute(SAMPLE_OUTPUT, sampleOutputText.getText());
-
- Control[] textBoxes = this.textFieldsComposite.getChildren();
- int numberOfColumns = textBoxes.length/2;
- configuration.setAttribute(NUMBER_OF_COLUMNS, numberOfColumns);
+ int numberOfRegexs = getNumberOfRegexs();
+ for (int r = 0; r < numberOfRegexs; r++) {
+ // Save data sets, and clear removed ones.
+ configuration.setAttribute(REGULAR_EXPRESSION + r, regularExpressionCombo.getItem(r));
+ configuration.setAttribute(SAMPLE_OUTPUT + r, outputList.get(r));
- for (int i = 0; i < numberOfColumns; i++) {
- String text = ((Text)textBoxes[i*2]).getText();
- configuration.setAttribute(REGEX_BOX+i, text);
+ ArrayList<String> columnNames = columnNamesList.get(r);
+ int numberOfColumns = columnNames.size();
+ for (int i = 0; i < numberOfColumns; i++) {
+ configuration.setAttribute(get2DConfigData(REGEX_BOX, r, i), columnNames.get(i));
+ }
+ cleanUpConfigurationItem(configuration, NUMBER_OF_COLUMNS, REGEX_BOX, r, numberOfColumns);
+ configuration.setAttribute(NUMBER_OF_COLUMNS + r, numberOfColumns);
+
+ // If the current regex has graphs with missing data, store all cached names
+ // in the configuration so that they will be easily restorable for next time.
+ Stack<String> extranames = cachedNamesList.get(r);
+ int numberOfExtras = findBadGraphs(r) == null ? 0 : extranames.size();
+ for (int i = 0; i < numberOfExtras; i++) {
+ configuration.setAttribute(get2DConfigData(EXTRA_BOX, r, i), extranames.get(i));
+ }
+ cleanUpConfigurationItem(configuration, NUMBER_OF_EXTRAS, EXTRA_BOX, r, numberOfExtras);
+ configuration.setAttribute(NUMBER_OF_EXTRAS + r, numberOfExtras);
+
+ // Save new graphs, and clear removed ones.
+ LinkedList<GraphData> list = graphsDataList.get(r);
+ int numberOfGraphs = list.size();
+ for (int i = 0; i < numberOfGraphs; i++) {
+ GraphData graphData = list.get(i);
+ configuration.setAttribute(get2DConfigData(GRAPH_TITLE, r, i), graphData.title);
+ configuration.setAttribute(get2DConfigData(GRAPH_KEY, r, i), graphData.key);
+ configuration.setAttribute(get2DConfigData(GRAPH_X_SERIES, r, i), graphData.xSeries);
+ configuration.setAttribute(get2DConfigData(GRAPH_ID, r, i), graphData.graphID);
+
+ int ySeriesLength = graphData.ySeries.length;
+ for (int j = 0; j < ySeriesLength; j++) {
+ configuration.setAttribute(get2DConfigData(GRAPH_Y_SERIES, r, i + "_" + j), //$NON-NLS-1$
+ graphData.ySeries[j]);
+ }
+ cleanUpConfigurationGraphYSeries(configuration, r, i, ySeriesLength);
+ configuration.setAttribute(get2DConfigData(GRAPH_Y_SERIES_LENGTH, r, i), ySeriesLength);
+ }
+ cleanUpConfigurationGraphs(configuration, r, numberOfGraphs);
+ configuration.setAttribute(NUMBER_OF_GRAPHS + r, numberOfGraphs);
}
- //clear what's unused
- for (int i = numberOfColumns; i < oldNumColumns; i++) {
- configuration.setAttribute(REGEX_BOX+i, (String) null);
+ cleanUpConfiguration(configuration, numberOfRegexs);
+ configuration.setAttribute(NUMBER_OF_REGEXS, numberOfRegexs);
+ }
+
+ /**
+ * Removes all configuration attributes associated with deleted regular expressions.
+ * @param configuration The configuration to remove attributes from.
+ * @param numberOfRegexs The number of regex-related properties to exist in the
+ * configuration after cleanup.
+ */
+ private void cleanUpConfiguration(ILaunchConfigurationWorkingCopy configuration, int numberOfRegexs) {
+ int oldNumberOfRegexs = 0;
+ try {
+ oldNumberOfRegexs = configuration.getAttribute(NUMBER_OF_REGEXS, 0);
+ } catch (CoreException e) {}
+ for (int r = numberOfRegexs; r < oldNumberOfRegexs; r++) {
+ configuration.removeAttribute(REGULAR_EXPRESSION + r);
+ configuration.removeAttribute(SAMPLE_OUTPUT + r);
+
+ cleanUpConfigurationItem(configuration, NUMBER_OF_COLUMNS, REGEX_BOX, r, 0);
+ configuration.removeAttribute(NUMBER_OF_COLUMNS + r);
+
+ cleanUpConfigurationItem(configuration, NUMBER_OF_COLUMNS, EXTRA_BOX, r, 0);
+ configuration.removeAttribute(NUMBER_OF_EXTRAS + r);
+
+ cleanUpConfigurationGraphs(configuration, r, 0);
+ configuration.removeAttribute(NUMBER_OF_GRAPHS + r);
}
- oldNumColumns = numberOfColumns;
+ }
- int numberOfExtras = (badGraphs.size() == 0) ? 0 : cachedNames.size();
- configuration.setAttribute(NUMBER_OF_EXTRAS, numberOfExtras);
- for (int i = 0; i < numberOfExtras; i++) {
- configuration.setAttribute(EXTRA_BOX+i, cachedNames.get(i));
+ private void cleanUpConfigurationGraphs(ILaunchConfigurationWorkingCopy configuration, int regex, int newNumberOfGraphs) {
+ int oldNumberOfGraphs = 0;
+ try {
+ oldNumberOfGraphs = configuration.getAttribute(NUMBER_OF_GRAPHS + regex, 0);
+ } catch (CoreException e) {}
+ for (int i = newNumberOfGraphs; i < oldNumberOfGraphs; i++) {
+ configuration.removeAttribute(get2DConfigData(GRAPH_TITLE, regex, i));
+ configuration.removeAttribute(get2DConfigData(GRAPH_KEY, regex, i));
+ configuration.removeAttribute(get2DConfigData(GRAPH_X_SERIES, regex, i));
+ configuration.removeAttribute(get2DConfigData(GRAPH_ID, regex, i));
+
+ cleanUpConfigurationGraphYSeries(configuration, regex, i, 0);
+ configuration.removeAttribute(get2DConfigData(GRAPH_Y_SERIES_LENGTH, regex, i));
}
- for (int i = numberOfExtras; i < oldNumExtras; i++) {
- configuration.setAttribute(EXTRA_BOX+i, (String) null);
+ }
+
+ private void cleanUpConfigurationItem(ILaunchConfigurationWorkingCopy configuration, String counter, String property, int regex, int newNumberOfItems) {
+ int oldNumberOfItems = 0;
+ try {
+ oldNumberOfItems = configuration.getAttribute(counter + regex, 0);
+ } catch (CoreException e) {}
+ for (int i = newNumberOfItems; i < oldNumberOfItems; i++) {
+ configuration.removeAttribute(get2DConfigData(property, regex, i));
}
- oldNumExtras = numberOfExtras;
+ }
- // Save graphs.
- TableItem[] list = this.graphsTable.getItems();
- configuration.setAttribute(NUMBER_OF_GRAPHS, list.length);
- for (int i = 0; i < list.length; i++) {
- GraphData graphData = (GraphData)list[i].getData();
- configuration.setAttribute(GRAPH_TITLE + i, graphData.title);
+ private void cleanUpConfigurationGraphYSeries(ILaunchConfigurationWorkingCopy configuration, int regex, int graph, int newLength) {
+ int oldYSeriesLength = 0;
+ try {
+ oldYSeriesLength = configuration.getAttribute(get2DConfigData(GRAPH_Y_SERIES_LENGTH, regex, graph), 0);
+ } catch (CoreException e) {}
+ for (int i = newLength; i < oldYSeriesLength; i++) {
+ configuration.removeAttribute(get2DConfigData(GRAPH_Y_SERIES, regex, graph + "_" + i)); //$NON-NLS-1$
+ }
+ }
- configuration.setAttribute(GRAPH_KEY + i, graphData.key);
- configuration.setAttribute(GRAPH_X_SERIES + i, graphData.xSeries);
- configuration.setAttribute(GRAPH_ID + i, graphData.graphID);
+ /**
+ * Checks all regular expressions for errors, except for the currently-selected
+ * expression (as it should be checked by {@link #refreshRegexRows}).
+ */
+ private void checkAllOtherErrors() {
+ for (int i = 0, n = getNumberOfRegexs(); i < n; i++) {
+ if (i == selectedRegex) {
+ continue;
+ }
- configuration.setAttribute(GRAPH_Y_SERIES_LENGTH + i, graphData.ySeries.length);
- for (int j = 0; j < graphData.ySeries.length; j++) {
- configuration.setAttribute(GRAPH_Y_SERIES + i + "_" + j, graphData.ySeries[j]); //$NON-NLS-1$
+ String error = findBadGraphs(i);
+ if (error == null) {
+ error = checkRegex(regularExpressionCombo.getItem(i));
}
- }
- addGraphButton.setEnabled(numberOfColumns > 0);
+ regexErrorMessages.set(i, error);
+ }
}
@Override
@@ -642,17 +1163,12 @@ public class SystemTapScriptGraphOptionsTab extends
return true;
}
- if (!this.regexErrorMessage.equals("")){ //$NON-NLS-1$
- setErrorMessage(regexErrorMessage);
- return false;
- }
- if (this.numberOfVisibleColumns == 0){
- setErrorMessage(Messages.SystemTapScriptGraphOptionsTab_9);
- return false;
- }
- if (badGraphs.size() > 0){
- setErrorMessage(Messages.SystemTapScriptGraphOptionsTab_8);
- return false;
+ for (int i = 0, n = getNumberOfRegexs(); i < n; i++) {
+ String regexErrorMessage = regexErrorMessages.get(i);
+ if (regexErrorMessage != null){
+ setErrorMessage(String.format("Expression \"%s\": %s", regularExpressionCombo.getItems()[i], regexErrorMessage)); //$NON-NLS-1$
+ return false;
+ }
}
return true;
@@ -678,6 +1194,9 @@ public class SystemTapScriptGraphOptionsTab extends
this.setControlEnabled(graphsGroup, enabled);
// Disable buttons that rely on a selected graph if no graph is selected.
this.setSelectionControlsEnabled(selectedTableItem != null);
+ this.addGraphButton.setEnabled(enabled && numberOfVisibleColumns > 0);
+ this.editGraphButton.setEnabled(enabled && numberOfVisibleColumns > 0);
+ this.removeRegexButton.setEnabled(enabled && getNumberOfRegexs() > 1);
updateLaunchConfigurationDialog();
}
@@ -697,7 +1216,7 @@ public class SystemTapScriptGraphOptionsTab extends
*/
private void setSelectionControlsEnabled(boolean enabled) {
duplicateGraphButton.setEnabled(enabled);
- editGraphButton.setEnabled(enabled);
+ editGraphButton.setEnabled(enabled && numberOfVisibleColumns > 0);
removeGraphButton.setEnabled(enabled);
}
}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/launcher/SystemTapScriptLaunchConfigurationDelegate.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/launcher/SystemTapScriptLaunchConfigurationDelegate.java
index 19649fd..2899a8a 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/launcher/SystemTapScriptLaunchConfigurationDelegate.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/launcher/SystemTapScriptLaunchConfigurationDelegate.java
@@ -12,6 +12,7 @@
package org.eclipse.linuxtools.internal.systemtap.ui.ide.launcher;
import java.util.LinkedList;
+import java.util.List;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -43,11 +44,15 @@ public class SystemTapScriptLaunchConfigurationDelegate implements
RunScriptHandler action;
boolean runWithChart = configuration.getAttribute(SystemTapScriptGraphOptionsTab.RUN_WITH_CHART, false);
- if (runWithChart){
- IDataSet dataSet = SystemTapScriptGraphOptionsTab.createDataset(configuration);
- IDataSetParser parser = SystemTapScriptGraphOptionsTab.createDatasetParser(configuration);
- LinkedList<GraphData> graphs = SystemTapScriptGraphOptionsTab.createGraphsFromConfiguration(configuration);
- action = new RunScriptChartHandler(parser, dataSet, graphs);
+ // If runWithChart is true there must be at least one graph, but this isn't guaranteed
+ // to be true for outdated Launch Configurations. So for safety, make sure there are graphs.
+ int numGraphs = configuration.getAttribute(SystemTapScriptGraphOptionsTab.NUMBER_OF_REGEXS, 0);
+ if (runWithChart && numGraphs > 0){
+ List<IDataSetParser> parsers = SystemTapScriptGraphOptionsTab.createDatasetParsers(configuration);
+ List<IDataSet> dataSets = SystemTapScriptGraphOptionsTab.createDataset(configuration);
+ List<String> names = SystemTapScriptGraphOptionsTab.createDatasetNames(configuration);
+ List<LinkedList<GraphData>> graphs = SystemTapScriptGraphOptionsTab.createGraphsFromConfiguration(configuration);
+ action = new RunScriptChartHandler(parsers, dataSets, names, graphs);
}else{
action = new RunScriptHandler();
}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/launcher/messages.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/launcher/messages.properties
index 54baeb2..5e0f2fa 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/launcher/messages.properties
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/launcher/messages.properties
@@ -22,8 +22,8 @@ SystemTapScriptGraphOptionsTab_4=Output Parsing:
SystemTapScriptGraphOptionsTab_5=Unable to initialize launch configuration tab
SystemTapScriptGraphOptionsTab_6=Cannot parse an empty string: remove '()'
SystemTapScriptGraphOptionsTab_7=Graphing
-SystemTapScriptGraphOptionsTab_8=Some of the created graphs rely on column data that has been deleted. Either re-add the columns or edit the affected graphs.
-SystemTapScriptGraphOptionsTab_9=Please designate the output to graph from the parsed regular expression. Do so by placing parentheses () around what you want to graph.
+SystemTapScriptGraphOptionsTab_8=Some of the graphs created for this expression rely on column data that has been deleted. Either re-add the columns or edit the affected graphs.
+SystemTapScriptGraphOptionsTab_9=Please designate the output to graph from this regular expression. Do so by placing parentheses () around what you want to graph.
SystemTapScriptGraphOptionsTab_0=Unable to initialize launch configuration tab
SystemTapScriptGraphOptionsTab_AddGraphButton=Add...
@@ -32,17 +32,31 @@ SystemTapScriptGraphOptionsTab_DuplicateGraphButton=Duplicate
SystemTapScriptGraphOptionsTab_DuplicateGraphButtonToolTip=Create a duplicate of the selected graph
SystemTapScriptGraphOptionsTab_EditGraphButton=Edit...
SystemTapScriptGraphOptionsTab_EditGraphButtonToolTip=Edit the selected graph
+SystemTapScriptGraphOptionsTab_columnTitle=Title
SystemTapScriptGraphOptionsTab_extractedValueLabel=Sample Extracted Value
+SystemTapScriptGraphOptionsTab_defaultColumnTitleBase=Column {0}
SystemTapScriptGraphOptionsTab_RemoveGraphButton=Remove
SystemTapScriptGraphOptionsTab_RemoveGraphButtonToolTip=Remove the selected graph
-SystemTapScriptGraphOptionsTab_graphsTitle=Graphs:
+SystemTapScriptGraphOptionsTab_invalidGraph=<Invalid>
+SystemTapScriptGraphOptionsTab_regexLabel=Regular Expression:
SystemTapScriptGraphOptionsTab_regexTooltip=Enter a regular expression that will match your expected output. Then add brackets around the values you would like to capture.\n\
For example to extract reads and writes from the string\n\
"read: 456 write: 789"\n\
use\n\
- "read: (\\d+) write: (\\d+)"
+ "read: (\\d+) write: (\\d+)"\n\
+ Note that you may use any number of unique regular expressions to capture multiple formats of data from your output.
+SystemTapScriptGraphOptionsTab_regexAddNew=New Regular Expression...
+SystemTapScriptGraphOptionsTab_regexRemove=Delete
+SystemTapScriptGraphOptionsTab_graphSetTitleBase=Graph Set {0}
+
+SystemTapScriptGraphOptionsTab_removeRegexTitle=Delete Regular Expression
+SystemTapScriptGraphOptionsTab_removeRegexAsk=Are you sure you want to delete the regular expression "{0}"?
+
SystemTapScriptGraphOptionsTab_sampleOutputLabel=Sample Output:
SystemTapScriptGraphOptionsTab_sampleOutputTooltip=Enter a line of output similar to what your script will produce to test out the parsing
+SystemTapScriptGraphOptionsTab_sampleOutputNoMatch=<no match found>
+SystemTapScriptGraphOptionsTab_sampleOutputIsEmpty=<no sample output entered>
+
SystemTapScriptLaunchConfigurationTab_0=Systemtap Script:
SystemTapScriptLaunchConfigurationTab_1=Browse...
SystemTapScriptLaunchConfigurationTab_2=Execute script as current user.
@@ -67,8 +81,4 @@ SystemTapScriptOptionsTab_3=dyninst
SystemTapScriptOptionsTab_4=When using dyninst you must specify a target PID or a target executable
SystemTapScriptOptionsTab_5=Please specify a proper pid
SystemTapScriptOptionsTab_initializeConfigurationFailed=Could not initialize configuration
-SystemTapScriptOptionsTab_targetToolTip=Select a target executable to be passed to systemtap using the -c option
-
-ParsingWizardPage_NumberOfColumns=Number of Columns:
-ParsingWizardPage_RegularExpression=Regular Expression
-ParsingWizardPage_Title=Title
+SystemTapScriptOptionsTab_targetToolTip=Select a target executable to be passed to systemtap using the -c option \ No newline at end of file