Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2013-09-18 08:02:00 -0400
committerUwe Stieber2013-09-18 08:06:12 -0400
commit473797305d4243ba76c3921a9a214d7c34b47ff9 (patch)
treeca7cb8d0412cad60a779f7e47a758499e30a715d /target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf
parent6ed2614942c85108b84f0a1daf655d2766e32caa (diff)
downloadorg.eclipse.tcf-473797305d4243ba76c3921a9a214d7c34b47ff9.tar.gz
org.eclipse.tcf-473797305d4243ba76c3921a9a214d7c34b47ff9.tar.xz
org.eclipse.tcf-473797305d4243ba76c3921a9a214d7c34b47ff9.zip
Target Explorer: Bind active connection status bar trim control to a hidden preference or system property. Use gray font and set tooltip.
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/ActiveConnectionStatusTrimControl.java14
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/preferences/IPreferenceKeys.java5
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/preferences/PreferencesInitializer.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/nls/Messages.java1
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/nls/Messages.properties3
5 files changed, 23 insertions, 2 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/ActiveConnectionStatusTrimControl.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/ActiveConnectionStatusTrimControl.java
index 5a020d44d..111e299da 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/ActiveConnectionStatusTrimControl.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/ActiveConnectionStatusTrimControl.java
@@ -26,6 +26,7 @@ import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
import org.eclipse.tcf.te.tcf.locator.interfaces.services.ISelectionService;
import org.eclipse.tcf.te.tcf.ui.nls.Messages;
import org.eclipse.tcf.te.ui.swt.SWTControlUtil;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.menus.WorkbenchWindowControlContribution;
/**
@@ -37,7 +38,7 @@ public class ActiveConnectionStatusTrimControl extends WorkbenchWindowControlCon
/* (non-Javadoc)
* @see org.eclipse.jface.action.ControlContribution#createControl(org.eclipse.swt.widgets.Composite)
*/
- @Override
+ @Override
protected Control createControl(Composite parent) {
Composite panel = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
@@ -46,6 +47,8 @@ public class ActiveConnectionStatusTrimControl extends WorkbenchWindowControlCon
text = new Text(panel, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY);
text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ text.setForeground(PlatformUI.getWorkbench().getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY));
+ text.setToolTipText(Messages.ActiveConnectionStatusTrimControl_tooltip);
String selected = ""; //$NON-NLS-1$
@@ -91,6 +94,15 @@ public class ActiveConnectionStatusTrimControl extends WorkbenchWindowControlCon
}
SWTControlUtil.setText(text, selected);
+ getParent().update(true);
}
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.action.ContributionItem#isDynamic()
+ */
+ @Override
+ public boolean isDynamic() {
+ return true;
+ }
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/preferences/IPreferenceKeys.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/preferences/IPreferenceKeys.java
index ea12e0c95..6bb9094f5 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/preferences/IPreferenceKeys.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/preferences/IPreferenceKeys.java
@@ -32,4 +32,9 @@ public interface IPreferenceKeys {
* Preference key to access the flag to activate the current user filter on first launch.
*/
public static final String PREF_ACTIVATE_CURRENT_USER_FILTER = PREFIX + "model.currentUserFilter.activate"; //$NON-NLS-1$
+
+ /**
+ * Preference key to access the flag to enable the active connection status bar trim area.
+ */
+ public static final String PREF_ACTIVE_CONNECTION_TRIM_AREA_ENABLE = PREFIX + "feature.statusbar.trim.activeconnection.enable"; //$NON-NLS-1$
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/preferences/PreferencesInitializer.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/preferences/PreferencesInitializer.java
index a14357ec3..df410dc86 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/preferences/PreferencesInitializer.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/preferences/PreferencesInitializer.java
@@ -37,5 +37,7 @@ public class PreferencesInitializer extends AbstractPreferenceInitializer {
store.setDefault(IPreferenceKeys.PREF_HIDE_VALUEADDS, true);
// [Hidden] Activate current user filter: default off
store.setDefault(IPreferenceKeys.PREF_ACTIVATE_CURRENT_USER_FILTER, false);
+ // [Hidden] Enable active connection status bar trim area: default off
+ store.setDefault(IPreferenceKeys.PREF_ACTIVE_CONNECTION_TRIM_AREA_ENABLE, false);
}
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/nls/Messages.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/nls/Messages.java
index 4bf693963..7561219f7 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/nls/Messages.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/nls/Messages.java
@@ -241,4 +241,5 @@ public class Messages extends NLS {
public static String PeerImportWizardPage_overwriteDialogToggle_message;
public static String ActiveConnectionStatusTrimControl_label;
+ public static String ActiveConnectionStatusTrimControl_tooltip;
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/nls/Messages.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/nls/Messages.properties
index 9b831c3ed..7178b5bd6 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/nls/Messages.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/nls/Messages.properties
@@ -199,5 +199,6 @@ PeerImportWizardPage_overwrite_button=Overwrite existing configuration(s) withou
PeerImportWizardPage_overwriteDialog_message=The configuration ''{0}'' already exists. Do you want to overwrite it?
PeerImportWizardPage_overwriteDialogToggle_message=Remember my decision
-ActiveConnectionStatusTrimControl_label=Active Connection: {0}
+ActiveConnectionStatusTrimControl_label={0}
+ActiveConnectionStatusTrimControl_tooltip=Most recently used connection

Back to the top