summaryrefslogtreecommitdiff
path: root/java/src/IceGridGUI/Application/PropertySet.java
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2006-12-15 00:06:59 +0000
committerBernard Normier <bernard@zeroc.com>2006-12-15 00:06:59 +0000
commit4c60c45b26926d584ed9b1d9f2c83488dd7ee2fd (patch)
tree13a1cdaf99912daaac31063dbd404d1c923ba13f /java/src/IceGridGUI/Application/PropertySet.java
parentFix (diff)
downloadice-4c60c45b26926d584ed9b1d9f2c83488dd7ee2fd.tar.bz2
ice-4c60c45b26926d584ed9b1d9f2c83488dd7ee2fd.tar.xz
ice-4c60c45b26926d584ed9b1d9f2c83488dd7ee2fd.zip
Added support for service property sets in icebox server instances
Diffstat (limited to 'java/src/IceGridGUI/Application/PropertySet.java')
-rwxr-xr-xjava/src/IceGridGUI/Application/PropertySet.java78
1 files changed, 69 insertions, 9 deletions
diff --git a/java/src/IceGridGUI/Application/PropertySet.java b/java/src/IceGridGUI/Application/PropertySet.java
index b55d9848532..bd0dbd9d274 100755
--- a/java/src/IceGridGUI/Application/PropertySet.java
+++ b/java/src/IceGridGUI/Application/PropertySet.java
@@ -85,8 +85,15 @@ class PropertySet extends TreeNode
if(!_ephemeral)
{
- parent.removeDescriptor(_id);
- parent.getEditable().removeElement(_id, _editable, PropertySet.class);
+ parent.removeDescriptor(_unsubstitutedId);
+ if(_editable != null)
+ {
+ parent.getEditable().removeElement(_unsubstitutedId, _editable, PropertySet.class);
+ }
+ else
+ {
+ parent.getEditable().markModified();
+ }
getRoot().updated();
}
}
@@ -95,16 +102,31 @@ class PropertySet extends TreeNode
{
if(_editor == null)
{
- _editor = (PropertySetEditor)getRoot().
- getEditor(PropertySetEditor.class, this);
+ if(_inServerInstance)
+ {
+ _editor = (PropertySetEditor)getRoot().
+ getEditor(ServerInstancePropertySetEditor.class, this);
+ }
+ else
+ {
+ _editor = (PropertySetEditor)getRoot().
+ getEditor(PropertySetEditor.class, this);
+ }
}
- _editor.show(this);
+ _editor.show(_unsubstitutedId, this);
return _editor;
}
protected Editor createEditor()
{
- return new PropertySetEditor();
+ if(_inServerInstance)
+ {
+ return new ServerInstancePropertySetEditor();
+ }
+ else
+ {
+ return new PropertySetEditor();
+ }
}
public boolean isEphemeral()
@@ -112,6 +134,11 @@ class PropertySet extends TreeNode
return _ephemeral;
}
+ public String unsubstitutedId()
+ {
+ return _unsubstitutedId;
+ }
+
Object getDescriptor()
{
return _descriptor;
@@ -130,28 +157,57 @@ class PropertySet extends TreeNode
void commit()
{
- _editable.commit();
+ if(_editable != null)
+ {
+ _editable.commit();
+ }
}
Editable getEditable()
{
- return _editable;
+ if(_editable != null)
+ {
+ return _editable;
+ }
+ else
+ {
+ return ((PropertySetParent)_parent).getEditable();
+ }
}
PropertySet(boolean brandNew,
TreeNode parent,
String id,
+ String unsubstitutedId,
PropertySetDescriptor descriptor)
{
super(parent, id);
+ _unsubstitutedId = unsubstitutedId;
+ _inServerInstance = (parent instanceof ServerInstance);
_ephemeral = false;
_editable = new Editable(brandNew);
rebuild(descriptor);
}
+
+ PropertySet(TreeNode parent,
+ String id,
+ String unsubstitutedId,
+ PropertySetDescriptor descriptor)
+ {
+ super(parent, id);
+ _unsubstitutedId = unsubstitutedId;
+ _inServerInstance = (parent instanceof ServerInstance);
+ _ephemeral = false;
+ _editable = null;
+ rebuild(descriptor);
+ }
+
PropertySet(TreeNode parent, String id, PropertySetDescriptor descriptor)
{
super(parent, id);
+ _unsubstitutedId = id;
+ _inServerInstance = (parent instanceof ServerInstance);
_ephemeral = true;
_editable = null;
rebuild(descriptor);
@@ -161,7 +217,9 @@ class PropertySet extends TreeNode
{
if(!_ephemeral)
{
- writePropertySet(writer, _id, _descriptor, null);
+ writePropertySet(writer, _unsubstitutedId,
+ _inServerInstance ? "service" : "id",
+ _descriptor, null);
}
}
@@ -171,8 +229,10 @@ class PropertySet extends TreeNode
}
private PropertySetDescriptor _descriptor;
+ private String _unsubstitutedId;
private final boolean _ephemeral;
private final Editable _editable;
+ private final boolean _inServerInstance;
private PropertySetEditor _editor;
static private DefaultTreeCellRenderer _cellRenderer;