diff options
author | Uwe Stieber | 2012-05-10 07:56:19 +0000 |
---|---|---|
committer | Uwe Stieber | 2012-05-10 07:56:19 +0000 |
commit | c7509c67215869a2baba55bd7a3e2ddc05165042 (patch) | |
tree | 52b75e5433655bc9321409541e375b39ad53294a /target_explorer/plugins/org.eclipse.tcf.te.runtime/src | |
parent | 21163c4e2af67407c8d16752a046b1061ee686de (diff) | |
download | org.eclipse.tcf-c7509c67215869a2baba55bd7a3e2ddc05165042.tar.gz org.eclipse.tcf-c7509c67215869a2baba55bd7a3e2ddc05165042.tar.xz org.eclipse.tcf-c7509c67215869a2baba55bd7a3e2ddc05165042.zip |
Target Explorer: Make it easier to extend NewTargetWizard/NewTargetWizardPage
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.runtime/src')
2 files changed, 41 insertions, 1 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/interfaces/properties/IPropertiesContainer.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/interfaces/properties/IPropertiesContainer.java index fcdb1316d..38fa2147c 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/interfaces/properties/IPropertiesContainer.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/interfaces/properties/IPropertiesContainer.java @@ -62,6 +62,14 @@ public interface IPropertiesContainer extends IAdaptable { public void setProperties(Map<String, Object> properties); /** + * Adds all properties from the given map. If a property already exist + * in the properties container, than the value of the property is overwritten. + * + * @param properties The map of properties to add. Must not be <code>null</code>. + */ + public void addProperties(Map<String, ?> properties); + + /** * Stores the property under the given property key using the given property value. * If the current property value is equal to the given property value, no store * operation will be executed. If the property value is not <code>null</code> and @@ -233,6 +241,14 @@ public interface IPropertiesContainer extends IAdaptable { public boolean isEmpty(); /** + * Returns whether this properties container contains the given key. + * + * @param key The key. Must not be <code>null</code>. + * @return <code>True</code> if the properties container contains the key, <code>false</code> if not. + */ + public boolean containsKey(String key); + + /** * Test if the property value stored under the given property is equal ignoring the case to the given * expected string value. * diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/properties/PropertiesContainer.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/properties/PropertiesContainer.java index ae8d5fc0d..6e9a24fa3 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/properties/PropertiesContainer.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/properties/PropertiesContainer.java @@ -400,7 +400,7 @@ public class PropertiesContainer extends PlatformObject implements IPropertiesCo *
* @param properties The map of properties set. Must not be <code>null</code>.
*/
- protected void postSetProperties(Map<String, Object> properties) {
+ protected void postSetProperties(Map<String, ?> properties) {
Assert.isTrue(checkThreadAccess(), "Illegal Thread Access"); //$NON-NLS-1$
Assert.isNotNull(properties);
@@ -408,6 +408,20 @@ public class PropertiesContainer extends PlatformObject implements IPropertiesCo }
/* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer#addProperties(java.util.Map)
+ */
+ @Override
+ public final void addProperties(Map<String, ?> properties) {
+ Assert.isTrue(checkThreadAccess(), "Illegal Thread Access"); //$NON-NLS-1$
+ Assert.isNotNull(properties);
+
+ // Apply everything from the given properties
+ this.properties.putAll(properties);
+ // And signal the change
+ postSetProperties(properties);
+ }
+
+ /* (non-Javadoc)
* @see org.eclipse.tcf.te.runtime.interfaces.IPropertiesContainer#setProperty(java.lang.String, boolean)
*/
@Override
@@ -522,6 +536,16 @@ public class PropertiesContainer extends PlatformObject implements IPropertiesCo }
/* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer#containsKey(java.lang.String)
+ */
+ @Override
+ public boolean containsKey(String key) {
+ Assert.isTrue(checkThreadAccess(), "Illegal Thread Access"); //$NON-NLS-1$
+ Assert.isNotNull(key);
+ return properties.containsKey(key);
+ }
+
+ /* (non-Javadoc)
* @see org.eclipse.tcf.te.runtime.interfaces.IPropertiesContainer#isProperty(java.lang.String, long)
*/
@Override
|