svn commit: r17718 - trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels: meta ui
Christian López Espínola <[email protected]>
| Newsgroups | gmane.comp.lang.uml.argouml.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: penyaskito
Date: 2010-01-02 06:06:22-0800
New Revision: 17718
Modified:
trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/PropertyMeta.java
trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/XMLPropertyPanelsHandler.java
trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/XmlSinglePanelHandler.java
trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/panels.xml
trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SwingUIFactory.java
Log:
Adding label to XML, so we can manage some special cases like attributes and operations (named features on the model).
Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/PropertyMeta.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/PropertyMeta.java?view=diff&pathrev=17718&r1=17717&r2=17718
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/PropertyMeta.java (original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/PropertyMeta.java 2010-01-02 06:06:22-0800
@@ -1,4 +1,18 @@
-// $Id$
+/* $Id$
+ *******************************************************************************
+ * Copyright (c) 2010 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian López Espínola
+ * Bob Tarling
+ *******************************************************************************
+ *
+ * Some portions of this file was previously release using the BSD License:
+ */
// Copyright (c) 2008 The Regents of the University of California. All
// Rights Reserved. Permission to use, copy, modify, and distribute this
// software and its documentation without fee, and without a written
@@ -38,15 +52,21 @@
private String controlType;
private String type;
private String name;
+ private String label;
private List<CheckBoxMeta> checkboxes = new LinkedList<CheckBoxMeta>();
// TODO: this is a tree node, we must refine the tree structure
- public PropertyMeta (String controlType, String name, String type) {
+ public PropertyMeta (String controlType, String name, String type, String label) {
this.controlType = controlType;
this.name = name;
this.type = type;
+
+ if (label != null)
+ this.label = label;
+ else
+ this.label = name;
}
public String getControlType() {
@@ -61,6 +81,10 @@
return name;
}
+ public String getLabel() {
+ return label;
+ }
+
public List<CheckBoxMeta> getCheckboxes() {
return Collections.unmodifiableList(checkboxes);
}
Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/XMLPropertyPanelsHandler.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/XMLPropertyPanelsHandler.java?view=diff&pathrev=17718&r1=17717&r2=17718
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/XMLPropertyPanelsHandler.java (original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/XMLPropertyPanelsHandler.java 2010-01-02 06:06:22-0800
@@ -1,4 +1,18 @@
-// $Id$
+/* $Id$
+ *******************************************************************************
+ * Copyright (c) 2010 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian López Espínola
+ * Bob Tarling
+ *******************************************************************************
+ *
+ * Some portions of this file was previously release using the BSD License:
+ */
// Copyright (c) 2008 The Regents of the University of California. All
// Rights Reserved. Permission to use, copy, modify, and distribute this
// software and its documentation without fee, and without a written
@@ -59,7 +73,7 @@
current.addCheckbox(record);
} else {
PropertyMeta record =
- new PropertyMeta(localName, attr.getValue("name"), attr.getValue("type"));
+ new PropertyMeta(localName, attr.getValue("name"), attr.getValue("type"), attr.getValue("label"));
if (hasChildren(localName)) {
current = record;
}
Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/XmlSinglePanelHandler.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/XmlSinglePanelHandler.java?view=diff&pathrev=17718&r1=17717&r2=17718
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/XmlSinglePanelHandler.java (original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/XmlSinglePanelHandler.java 2010-01-02 06:06:22-0800
@@ -1,4 +1,18 @@
-// $Id$
+/* $Id$
+ *******************************************************************************
+ * Copyright (c) 2010 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian López Espínola
+ * Bob Tarling
+ *******************************************************************************
+ *
+ * Some portions of this file was previously release using the BSD License:
+ */
// Copyright (c) 2008 The Regents of the University of California. All
// Rights Reserved. Permission to use, copy, modify, and distribute this
// software and its documentation without fee, and without a written
@@ -77,7 +91,7 @@
} else {
PropertyMeta record =
new PropertyMeta(localName,
- attr.getValue("name"), attr.getValue("type"));
+ attr.getValue("name"), attr.getValue("type"), attr.getValue("label"));
if (hasChildren(localName)) {
current = record;
}
Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/panels.xml
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/panels.xml?view=diff&pathrev=17718&r1=17717&r2=17718
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/panels.xml (original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/panels.xml 2010-01-02 06:06:22-0800
@@ -207,8 +207,8 @@
<!--
<list name="feature" type="Feature" />
-->
- <list name="feature" type="Attribute" />
- <list name="feature" type="Operation" />
+ <list name="feature" type="Attribute" label="Attributes" />
+ <list name="feature" type="Operation" label="Operations" />
<list name="association" type="Classifier" />
<list name="ownedElement" type="ModelElement" />
Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SwingUIFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SwingUIFactory.java?view=diff&pathrev=17718&r1=17717&r2=17718
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SwingUIFactory.java (original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SwingUIFactory.java 2010-01-02 06:06:22-0800
@@ -8,9 +8,11 @@
*
* Contributors:
* Bob Tarling - Post GSOC improvements
+ * Christian López Espínola
*******************************************************************************
+ *
+ * Some portions of this file was previously release using the BSD License:
*/
-
// $Id$
// Copyright (c) 2008 The Regents of the University of California. All
// Rights Reserved. Permission to use, copy, modify, and distribute this
@@ -171,7 +173,7 @@
addControl(panel, null, control);
} else {
// if not, it is a control and must be labeled...
- addControl(panel, prop.getName(), control);
+ addControl(panel, prop.getLabel(), control);
}
} else {
final GetterSetterManager getterSetter = GetterSetterManager.getGetterSetter();
@@ -198,7 +200,7 @@
factory.createComponent(target, prop.getName(), prop.getType());
if (pane != null) {
- addControl(panel, prop.getName(), pane);
+ addControl(panel, prop.getLabel(), pane);
}
}
@@ -211,7 +213,7 @@
factory.createComponent(target, prop.getName(), prop.getType());
if (list != null) {
- addControl(panel, prop.getName(), list);
+ addControl(panel, prop.getLabel(), list);
}
}
@@ -442,7 +444,7 @@
}
if (comp != null) {
- addControl(panel, prop.getName(), comp);
+ addControl(panel, prop.getLabel(), comp);
}
}
@@ -471,7 +473,7 @@
if (document != null) {
JTextField tfield = new UMLTextField(document);
- addControl(panel, prop.getName(), tfield);
+ addControl(panel, prop.getLabel(), tfield);
}
}
------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2434201
To unsubscribe from this discussion, e-mail: [[email protected]].