Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2012-09-21 07:11:14 +0000
committerUwe Stieber2012-09-21 07:11:14 +0000
commitf51f616f506e9de9f5c70503d45c4d3d4fa9a70f (patch)
treefb57e34a7a702efb3ae8370c24f0d70be0859ad5 /target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui
parent00c276a8182102391351da481007048a73326dfc (diff)
downloadorg.eclipse.tcf-f51f616f506e9de9f5c70503d45c4d3d4fa9a70f.tar.gz
org.eclipse.tcf-f51f616f506e9de9f5c70503d45c4d3d4fa9a70f.tar.xz
org.eclipse.tcf-f51f616f506e9de9f5c70503d45c4d3d4fa9a70f.zip
Target Explorer: Prepare customization of path map table column headers
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/PathMapEditorPage.java22
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.java42
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.properties4
3 files changed, 68 insertions, 0 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/PathMapEditorPage.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/PathMapEditorPage.java
index c277b9d5d..8466085af 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/PathMapEditorPage.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/PathMapEditorPage.java
@@ -10,7 +10,11 @@
package org.eclipse.tcf.te.tcf.launch.ui.editor;
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.tcf.internal.debug.ui.launch.TCFPathMapTab;
+import org.eclipse.tcf.te.tcf.launch.ui.nls.Messages;
/**
* TCF path map launch configuration tab container page implementation.
@@ -29,6 +33,24 @@ public class PathMapEditorPage extends AbstractTcfLaunchTabContainerEditorPage {
performApply(getLaunchConfig(getPeerModel(getEditorInput())));
checkLaunchConfigDirty();
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.internal.debug.ui.launch.TCFPathMapTab#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ public void createControl(Composite parent) {
+ super.createControl(parent);
+
+ TableViewer viewer = getViewer();
+ if (viewer != null) {
+ TableColumn[] columns = viewer.getTable().getColumns();
+ for (TableColumn column : columns) {
+ String label = column.getText();
+ String key = "PathMapEditorPage_column_" + label.toLowerCase(); //$NON-NLS-1$
+ if (Messages.hasString(key)) column.setText(Messages.getString(key));
+ }
+ }
+ }
};
}
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.java
index 46e49de4d..8e5985561 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.java
@@ -9,6 +9,8 @@
*******************************************************************************/
package org.eclipse.tcf.te.tcf.launch.ui.nls;
+import java.lang.reflect.Field;
+
import org.eclipse.osgi.util.NLS;
/**
@@ -27,6 +29,42 @@ public class Messages extends NLS {
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}
+ /**
+ * Returns if or if not this NLS manager contains a constant for
+ * the given externalized strings key.
+ *
+ * @param key The externalized strings key or <code>null</code>.
+ * @return <code>True</code> if a constant for the given key exists, <code>false</code> otherwise.
+ */
+ public static boolean hasString(String key) {
+ if (key != null) {
+ try {
+ Field field = Messages.class.getDeclaredField(key);
+ return field != null;
+ } catch (NoSuchFieldException e) { /* ignored on purpose */ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns the corresponding string for the given externalized strings
+ * key or <code>null</code> if the key does not exist.
+ *
+ * @param key The externalized strings key or <code>null</code>.
+ * @return The corresponding string or <code>null</code>.
+ */
+ public static String getString(String key) {
+ if (key != null) {
+ try {
+ Field field = Messages.class.getDeclaredField(key);
+ return (String)field.get(null);
+ } catch (Exception e) { /* ignored on purpose */ }
+ }
+
+ return null;
+ }
+
// **** Declare externalized string id's down here *****
public static String LaunchConfigurationMainTabSection_title;
@@ -53,4 +91,8 @@ public class Messages extends NLS {
public static String LaunchConfigurationAdvancedTabSection_lineseparator_lf;
public static String LaunchConfigurationAdvancedTabSection_lineseparator_crlf;
public static String LaunchConfigurationAdvancedTabSection_lineseparator_cr;
+
+// public static String PathMapEditorPage_column_source;
+// public static String PathMapEditorPage_column_destination;
+ public static String PathMapEditorPage_column_contextquery;
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.properties
index 60f850f4e..d89726679 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.properties
@@ -32,3 +32,7 @@ LaunchConfigurationAdvancedTabSection_lineseparator_default=Default
LaunchConfigurationAdvancedTabSection_lineseparator_lf=LF
LaunchConfigurationAdvancedTabSection_lineseparator_crlf=CRLF
LaunchConfigurationAdvancedTabSection_lineseparator_cr=CR
+
+#PathMapEditorPage_column_source=Local
+#PathMapEditorPage_column_destination=Origin
+PathMapEditorPage_column_contextquery=Context Query

Back to the top