Author: tfmorris
Date: 2008-06-05 16:43:06-0700
New Revision: 14872
Modified:
trunk/src/argouml-app/src/org/argouml/uml/reveng/Setting.java
trunk/src/argouml-app/src/org/argouml/uml/reveng/SettingsTypes.java
Log:
Issue 5123: Add path and list of paths to supported settings types
Modified: trunk/src/argouml-app/src/org/argouml/uml/reveng/Setting.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/reveng/Setting.java?view=diff&rev=14872&p1=trunk/src/argouml-app/src/org/argouml/uml/reveng/Setting.java&p2=trunk/src/argouml-app/src/org/argouml/uml/reveng/Setting.java&r1=14871&r2=14872
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/reveng/Setting.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/reveng/Setting.java 2008-06-05 16:43:06-0700
@@ -24,18 +24,22 @@
package org.argouml.uml.reveng;
+import java.util.List;
+
/**
* Common class that all settings types inherit from. It provides
* a label to be associated with the setting in the user interface.
*/
-public class Setting implements SettingsTypes.Setting {
+public class Setting implements SettingsTypes.Setting2 {
/**
* The message of the Label.
*/
private String label;
+ private String description;
+
/**
* Construct a new Setting with the given label text.
*
@@ -45,17 +49,30 @@
super();
label = labelText;
}
-
- /*
- * @see org.argouml.uml.reveng.SettingsTypes.Setting#getLabel()
+
+ /**
+ * Construct a new Setting with the given label text and description.
+ *
+ * @param labelText string to use as the label
+ * @param descriptionText string to use as description
*/
+ public Setting(String labelText, String descriptionText) {
+ this(labelText);
+ description = descriptionText;
+ }
+
+
public final String getLabel() {
return label;
}
+
+ public String getDescription() {
+ return description;
+ }
/**
* Setting which specifies a boolean value. Typical user presentation
- * would be labelled checkbox.
+ * would be labeled checkbox.
*/
public static class BooleanSelection extends Setting
implements SettingsTypes.BooleanSelection {
@@ -90,4 +107,90 @@
return defaultValue;
}
}
+
+ public static class UniqueSelection extends Setting implements
+ SettingsTypes.UniqueSelection {
+
+ private List<String> options;
+
+ private int selection;
+
+ public UniqueSelection(String labelText, List<String> optionLabels,
+ int defaultSelection) {
+ super(labelText);
+ options = optionLabels;
+ this.selection = selection;
+ }
+
+ public int getDefaultSelection() {
+ return selection;
+ }
+
+ public List<String> getOptions() {
+ return options;
+ }
+
+ public boolean setSelection(int selection) {
+ this.selection = selection;
+ return true;
+ }
+ }
+
+ public static class PathSelection extends Setting implements
+ SettingsTypes.PathSelection {
+
+ private String path;
+
+ private String defaultPath;
+
+ public PathSelection(String labelText, String descriptionText,
+ String defaultPath) {
+ super(labelText, descriptionText);
+ this.defaultPath = defaultPath;
+ path = defaultPath;
+ }
+
+ public String getDefaultPath() {
+ return defaultPath;
+ }
+
+ public String getPath() {
+ return path;
+ }
+
+ /**
+ * Set the path selection so that it is available to the importer.
+ *
+ * @param newPath string representing the new path
+ */
+ public void setPath(String newPath) {
+ path = newPath;
+ }
+
+ }
+
+ public static class PathListSelection extends Setting implements
+ SettingsTypes.PathListSelection {
+
+ private List<String> defaultPathList;
+
+ private List<String> pathList;
+
+ public PathListSelection(String labelText, String descriptionText,
+ List<String> defaultPathList) {
+ super(labelText, descriptionText);
+ this.defaultPathList = defaultPathList;
+ pathList = defaultPathList;
+ }
+
+ public List<String> getDefaultPathList() {
+ return defaultPathList;
+ }
+
+ public List<String> getPathList() {
+ return pathList;
+ }
+
+ }
+
}
\ No newline at end of file
Modified: trunk/src/argouml-app/src/org/argouml/uml/reveng/SettingsTypes.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/reveng/SettingsTypes.java?view=diff&rev=14872&p1=trunk/src/argouml-app/src/org/argouml/uml/reveng/SettingsTypes.java&p2=trunk/src/argouml-app/src/org/argouml/uml/reveng/SettingsTypes.java&r1=14871&r2=14872
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/reveng/SettingsTypes.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/reveng/SettingsTypes.java 2008-06-05 16:43:06-0700
@@ -46,6 +46,21 @@
* @return the String message
*/
String getLabel();
+
+ }
+
+
+ /**
+ * A setting which provides a description as well as a label.
+ */
+ interface Setting2 extends Setting {
+
+ /**
+ * Returns a string with an extended description of the setting,
+ * suitable for use as a tooltip or help message.
+ * @return the description
+ */
+ String getDescription();
}
/**
@@ -64,7 +79,7 @@
/**
* Returns the available options from which the user can pick one.
*
- * @return a list with Strings that identinfies the options
+ * @return a list with Strings that identifies the options
*/
List<String> getOptions();
@@ -119,5 +134,38 @@
*/
boolean isSelected();
}
+
+ /**
+ * File system path setting. A single path in the file system.
+ */
+ interface PathSelection extends Setting2 {
+
+ /**
+ * @return the default path to use when first displayed
+ */
+ String getDefaultPath();
+
+ /**
+ * @return the user selected path
+ */
+ String getPath();
+ }
+
+ /**
+ * Setting containing ordered list of file system paths. Suitable for use
+ * for things like a Java classpath or an preprocessor include path list.
+ */
+ interface PathListSelection extends Setting2 {
+
+ /**
+ * @return the default list of paths to use when first displayed
+ */
+ List<String> getDefaultPathList();
+
+ /**
+ * @return the user selected ordered list of file system paths
+ */
+ List<String> getPathList();
+ }
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.