svn commit: r15041 - trunk/src/argouml-app: src/org/argouml/uml/reveng src/org/argouml/uml/reveng/java src/org/argouml/uml/reveng/ui tests/org/argouml/uml/reveng

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2008-06-22 15:03:27-0700
New Revision: 15041

Removed:
   trunk/src/argouml-app/src/org/argouml/uml/reveng/ExtendedImportInterface.java
   trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportCommand.java
   trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportCommandInterface.java
   trunk/src/argouml-app/src/org/argouml/uml/reveng/SettingUniqueSelection.java
Modified:
   trunk/src/argouml-app/src/org/argouml/uml/reveng/Import.java
   trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportClassLoader.java
   trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportCommon.java
   trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportInterface.java
   trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportSettings.java
   trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportSettingsInternal.java
   trunk/src/argouml-app/src/org/argouml/uml/reveng/Setting.java
   trunk/src/argouml-app/src/org/argouml/uml/reveng/SettingsTypes.java
   trunk/src/argouml-app/src/org/argouml/uml/reveng/java/JavaImport.java
   trunk/src/argouml-app/src/org/argouml/uml/reveng/java/Modeller.java
   trunk/src/argouml-app/src/org/argouml/uml/reveng/ui/ImportClasspathDialog.java
   trunk/src/argouml-app/src/org/argouml/uml/reveng/ui/RESequenceDiagramDialog.java
   trunk/src/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportClass.java
   trunk/src/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportEnumeration.java
   trunk/src/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportInterface.java
   trunk/src/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportUnicode.java

Log:
Issue 5123: Enhance import settings API to handle additional types.
Remove Swing-specific hack from Java importer.
Remove all Java-specific settings from common importer framework and move to Java/classfile importers.
Switch source file character encoding selector to combobox instead of free form text.

Removed: trunk/src/argouml-app/src/org/argouml/uml/reveng/ExtendedImportInterface.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/reveng/ExtendedImportInterface.java?view=auto&rev=15040

Modified: trunk/src/argouml-app/src/org/argouml/uml/reveng/Import.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/reveng/Import.java?view=diff&rev=15041&p1=trunk/src/argouml-app/src/org/argouml/uml/reveng/Import.java&p2=trunk/src/argouml-app/src/org/argouml/uml/reveng/Import.java&r1=15040&r2=15041
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/reveng/Import.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/reveng/Import.java	2008-06-22 15:03:27-0700
@@ -26,9 +26,16 @@
 
 import java.awt.BorderLayout;
 import java.awt.Frame;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
 import java.io.File;
+import java.nio.charset.Charset;
+import java.util.List;
 import java.util.StringTokenizer;
 
 import javax.swing.ButtonGroup;
@@ -48,15 +55,30 @@
 import org.argouml.configuration.Configuration;
 import org.argouml.i18n.Translator;
 import org.argouml.moduleloader.ModuleInterface;
+import org.argouml.uml.reveng.SettingsTypes.BooleanSelection2;
+import org.argouml.uml.reveng.SettingsTypes.PathListSelection;
+import org.argouml.uml.reveng.SettingsTypes.PathSelection;
+import org.argouml.uml.reveng.SettingsTypes.Setting;
+import org.argouml.uml.reveng.SettingsTypes.UniqueSelection2;
+import org.argouml.uml.reveng.SettingsTypes.UserString2;
+import org.argouml.uml.reveng.ui.ImportClasspathDialog;
 import org.argouml.uml.reveng.ui.ImportStatusScreen;
 import org.argouml.util.SuffixFilter;
 import org.argouml.util.UIUtils;
 import org.tigris.gef.base.Globals;
 import org.tigris.swidgets.GridLayout2;
 
+
+
 /**
- * This is the main class for all import classes.
+ * This is the main class for the Swing importer framework.  It extends 
+ * ImportCommon which contains all the GUI independent pieces of the import
+ * framework.  
  * <p>
+ * The Service Providers Interface (SPI) to the individual language importers
+ * is defined in such a way that they can be completely GUI independent as
+ * well, receiving lists of source files and settings for the import and 
+ * reporting progress via progress monitor API.
  * 
  * It provides JPanels for tailoring the import run in the FileChooser.
  * <p>
@@ -64,10 +86,11 @@
  * The Import run is started by calling doFile(Project, File)
  * <p>
  * 
- * Supports recursive search in folder for all .java classes.
+ * Supports recursive search in folder for source files with matching 
+ * extensions.
  * <p>
  * 
- * There are now 3 levels of detail for import:
+ * There are three levels of detail for import:
  * <p>
  * 
  * <ol>
@@ -77,6 +100,7 @@
  * </ol>
  * 
  * @author Andreas Rueckert [email protected]
+ * @author Tom Morris <[email protected]>
  */
 public class Import extends ImportCommon implements ImportSettings {
 
@@ -101,11 +125,8 @@
     // level 2 import detail
     private JRadioButton fullImport;
 
-    // import detail level var:
-    // private int importLevel;
-
-    private JTextField inputSourceEncoding;
-
+    private JComboBox sourceEncoding;
+    
     private JDialog dialog;
 
     private ImportStatusScreen iss;
@@ -113,13 +134,6 @@
     private Frame myFrame;
 
     /**
-     * The default extended configuration panel. TODO: This used to be provided
-     * by the abstract class FileImportSupport and it can be merged with our
-     * main configuration panel here.
-     */
-    private ConfigPanelExtension importConfigPanel;
-
-    /**
      * Creates dialog window with chooser and configuration panel.
      * 
      * @param frame the ui frame to display dialogs on
@@ -129,11 +143,12 @@
         myFrame = frame;
 
         JComponent chooser = getChooser();
-        dialog = new JDialog(frame, Translator
-                .localize("action.import-sources"), true);
+        dialog =
+            new JDialog(frame,
+                    Translator.localize("action.import-sources"), true);
 
         dialog.getContentPane().add(chooser, BorderLayout.CENTER);
-        dialog.getContentPane().add(getConfigPanel(this), BorderLayout.EAST);
+        dialog.getContentPane().add(getConfigPanel(), BorderLayout.EAST);
         dialog.pack();
         int x = (frame.getSize().width - dialog.getSize().width) / 2;
         int y = (frame.getSize().height - dialog.getSize().height) / 2;
@@ -148,25 +163,23 @@
      * @see org.argouml.uml.reveng.ImportSettings#getInputSourceEncoding()
      */
     public String getInputSourceEncoding() {
-        return inputSourceEncoding.getText();
+        return (String) sourceEncoding.getSelectedItem();
     }
 
     /*
      * @see org.argouml.uml.reveng.ImportSettings#isAttributeSelected()
      */
+    @Deprecated
     public boolean isAttributeSelected() {
-        // This is only valid for new style importers, but they're also
-        // the only ones invoking this method
-        return importConfigPanel.getAttribute().isSelected();
+        return false;
     }
 
     /*
      * @see org.argouml.uml.reveng.ImportSettings#isDatatypeSelected()
      */
+    @Deprecated
     public boolean isDatatypeSelected() {
-        // This is only valid for new style importers, but they're also
-        // the only ones invoking this method
-        return importConfigPanel.getDatatype().isSelected();
+        return false;
     }
 
     /**
@@ -185,9 +198,6 @@
                 .valueOf(getImportLevel()));
         Configuration.setString(Argo.KEY_INPUT_SOURCE_ENCODING,
                 getInputSourceEncoding());
-        if (importConfigPanel != null) {
-            importConfigPanel.disposeDialog();
-        }
         dialog.setVisible(false);
         dialog.dispose();
     }
@@ -199,139 +209,29 @@
      * @return the panel This is an internal method. Use the accessors in
      *         {@link ImportSettings} to determine the current settings.
      */
-    private JComponent getConfigPanel(final Import importInstance) {
+    private JComponent getConfigPanel() {
 
         final JTabbedPane tab = new JTabbedPane();
 
         // build the configPanel:
         if (configPanel == null) {
             JPanel general = new JPanel();
-            general.setLayout(new GridLayout2(13, 1, 0, 0, GridLayout2.NONE));
+            general.setLayout(new GridLayout2(20, 1, 0, 0, GridLayout2.NONE));
 
             general.add(new JLabel(Translator
                     .localize("action.import-select-lang")));
 
             JComboBox selectedLanguage = new JComboBox(getModules().keySet()
                     .toArray());
-            selectedLanguage.addActionListener(new SelectedLanguageListener(
-                    importInstance, tab));
+            selectedLanguage
+                    .addActionListener(new SelectedLanguageListener(tab));
             general.add(selectedLanguage);
 
-            boolean desc = true;
-            boolean chan = true;
-            boolean crea = true;
-            boolean mini = true;
-            boolean layo = true;
-            String flags = Configuration
-                    .getString(Argo.KEY_IMPORT_GENERAL_SETTINGS_FLAGS);
-            if (flags != null && flags.length() > 0) {
-                StringTokenizer st = new StringTokenizer(flags, ",");
-                if (st.hasMoreTokens() && st.nextToken().equals("false")) {
-                    desc = false;
-                }
-                if (st.hasMoreTokens() && st.nextToken().equals("false")) {
-                    chan = false;
-                }
-                if (st.hasMoreTokens() && st.nextToken().equals("false")) {
-                    crea = false;
-                }
-                if (st.hasMoreTokens() && st.nextToken().equals("false")) {
-                    mini = false;
-                }
-                if (st.hasMoreTokens() && st.nextToken().equals("false")) {
-                    layo = false;
-                }
-            }
+            addConfigCheckboxes(general);
 
-            descend = new JCheckBox(Translator
-                    .localize("action.import-option-descend-dir-recur"), desc);
-            general.add(descend);
-
-            changedOnly = new JCheckBox(Translator
-                    .localize("action.import-option-changed_new"), chan);
-            general.add(changedOnly);
-
-            createDiagrams = new JCheckBox(Translator
-                    .localize("action.import-option-create-diagram"), crea);
-            general.add(createDiagrams);
-
-            minimiseFigs = new JCheckBox(Translator
-                    .localize("action.import-option-min-class-icon"), mini);
-            general.add(minimiseFigs);
-
-            layoutDiagrams = new JCheckBox(Translator.localize(
-                    "action.import-option-perform-auto-diagram-layout"),
-                    layo);
-            general.add(layoutDiagrams);
-
-            // de-selects the fig minimising & layout
-            // if we are not creating diagrams
-            createDiagrams.addActionListener(new ActionListener() {
-                public void actionPerformed(ActionEvent actionEvent) {
-                    if (!createDiagrams.isSelected()) {
-                        minimiseFigs.setSelected(false);
-                        layoutDiagrams.setSelected(false);
-                    }
-                }
-            });
+            addDetailLevelButtons(general);
 
-            // select the level of import
-            // 0 - classifiers only
-            // 1 - classifiers plus feature specifications
-            // 2 - full import, feature detail
-
-            JLabel importDetailLabel = new JLabel(Translator
-                    .localize("action.import-level-of-import-detail"));
-            ButtonGroup detailButtonGroup = new ButtonGroup();
-
-            classOnly = new JRadioButton(Translator
-                    .localize("action.import-option-classifiers"));
-            detailButtonGroup.add(classOnly);
-
-            classAndFeatures = new JRadioButton(Translator
-                    .localize("action.import-option-classifiers-plus-specs"));
-            detailButtonGroup.add(classAndFeatures);
-
-            fullImport = new JRadioButton(Translator
-                    .localize("action.import-option-full-import"));
-            String detaillevel = Configuration
-                    .getString(Argo.KEY_IMPORT_GENERAL_DETAIL_LEVEL);
-            if ("0".equals(detaillevel)) {
-                classOnly.setSelected(true);
-            } else if ("1".equals(detaillevel)) {
-                classAndFeatures.setSelected(true);
-            } else {
-                fullImport.setSelected(true);
-            }
-            detailButtonGroup.add(fullImport);
-
-            general.add(importDetailLabel);
-            general.add(classOnly);
-            general.add(classAndFeatures);
-            general.add(fullImport);
-
-            general.add(new JLabel(Translator
-                    .localize("action.import-file-encoding")));
-            String enc = Configuration
-                    .getString(Argo.KEY_INPUT_SOURCE_ENCODING);
-            if (enc == null || enc.trim().equals("")) {
-                inputSourceEncoding = new JTextField(System
-                        .getProperty("file.encoding"));
-            } else {
-                inputSourceEncoding = new JTextField(enc);
-
-            }
-            general.add(inputSourceEncoding);
-
-            // TODO: Encoding needs to be validated against set of
-            // available encodings using {@link Charset.isSupported(String)}
-            // -- or use a menu with the contents of
-            // {@link Charset.availableCharsets()}
-            // JComboBox encoding =
-            // new JComboBox(Charset.availableCharsets().keySet()
-            // .toArray());
-            // encoding.setSelectedItem(inputSourceEncoding.getText());
-            // general.add(encoding);
+            addSourceEncoding(general);
 
             tab.add(general, Translator.localize("action.import-general"));
             tab.add(getConfigPanelExtension(),
@@ -342,26 +242,137 @@
 
     }
 
+
+    private void addConfigCheckboxes(JPanel panel) {
+        boolean desc = true;
+        boolean chan = true;
+        boolean crea = true;
+        boolean mini = true;
+        boolean layo = true;
+        String flags = Configuration
+                .getString(Argo.KEY_IMPORT_GENERAL_SETTINGS_FLAGS);
+        if (flags != null && flags.length() > 0) {
+            StringTokenizer st = new StringTokenizer(flags, ",");
+            if (st.hasMoreTokens() && st.nextToken().equals("false")) {
+                desc = false;
+            }
+            if (st.hasMoreTokens() && st.nextToken().equals("false")) {
+                chan = false;
+            }
+            if (st.hasMoreTokens() && st.nextToken().equals("false")) {
+                crea = false;
+            }
+            if (st.hasMoreTokens() && st.nextToken().equals("false")) {
+                mini = false;
+            }
+            if (st.hasMoreTokens() && st.nextToken().equals("false")) {
+                layo = false;
+            }
+        }
+
+        descend = new JCheckBox(Translator
+                .localize("action.import-option-descend-dir-recur"), desc);
+        panel.add(descend);
+
+        changedOnly = new JCheckBox(Translator
+                .localize("action.import-option-changed_new"), chan);
+        panel.add(changedOnly);
+
+        createDiagrams = new JCheckBox(Translator
+                .localize("action.import-option-create-diagram"), crea);
+        panel.add(createDiagrams);
+
+        minimiseFigs = new JCheckBox(Translator
+                .localize("action.import-option-min-class-icon"), mini);
+        panel.add(minimiseFigs);
+
+        layoutDiagrams = new JCheckBox(Translator.localize(
+                "action.import-option-perform-auto-diagram-layout"),
+                layo);
+        panel.add(layoutDiagrams);
+
+        // de-selects the fig minimising & layout
+        // if we are not creating diagrams
+        createDiagrams.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent actionEvent) {
+                if (!createDiagrams.isSelected()) {
+                    minimiseFigs.setSelected(false);
+                    layoutDiagrams.setSelected(false);
+                }
+            }
+        });
+    }
+
+
+    private void addDetailLevelButtons(JPanel panel) {
+        // select the level of import
+        // 0 - classifiers only
+        // 1 - classifiers plus feature specifications
+        // 2 - full import, feature detail
+
+        JLabel importDetailLabel = new JLabel(Translator
+                .localize("action.import-level-of-import-detail"));
+        ButtonGroup detailButtonGroup = new ButtonGroup();
+
+        classOnly = new JRadioButton(Translator
+                .localize("action.import-option-classifiers"));
+        detailButtonGroup.add(classOnly);
+
+        classAndFeatures = new JRadioButton(Translator
+                .localize("action.import-option-classifiers-plus-specs"));
+        detailButtonGroup.add(classAndFeatures);
+
+        fullImport = new JRadioButton(Translator
+                .localize("action.import-option-full-import"));
+        String detaillevel = Configuration
+                .getString(Argo.KEY_IMPORT_GENERAL_DETAIL_LEVEL);
+        if ("0".equals(detaillevel)) {
+            classOnly.setSelected(true);
+        } else if ("1".equals(detaillevel)) {
+            classAndFeatures.setSelected(true);
+        } else {
+            fullImport.setSelected(true);
+        }
+        detailButtonGroup.add(fullImport);
+
+        panel.add(importDetailLabel);
+        panel.add(classOnly);
+        panel.add(classAndFeatures);
+        panel.add(fullImport);
+    }
+    
+    
+    private void addSourceEncoding(JPanel panel) {
+        panel.add(new JLabel(
+                Translator.localize("action.import-file-encoding")));
+        String enc =
+            Configuration.getString(Argo.KEY_INPUT_SOURCE_ENCODING);
+        if (enc == null || enc.trim().equals("")) {
+            enc = System.getProperty("file.encoding");
+        }
+        // cp1252 is often the default, but windows-1252 is the name listed
+        // by Charset.availableCharsets
+        if (enc.startsWith("cp")) {
+            enc = "windows-" + enc.substring(2);
+        }
+
+        sourceEncoding = new JComboBox(Charset
+                .availableCharsets().keySet().toArray());
+        sourceEncoding.setSelectedItem(enc);
+        panel.add(sourceEncoding);
+    }
+    
     /*
      * Get the extension panel for the configuration settings.
      */
     private JComponent getConfigPanelExtension() {
-        // New style importers don't provide a config panel
-        // TODO: This needs review for the new style importers - tfm - 20070527
-        if (importConfigPanel == null) {
-            importConfigPanel = new ConfigPanelExtension();
-        }
-        return importConfigPanel;
+        List<Setting> settings = getCurrentModule().getImportSettings();
+        return  new ConfigPanelExtension(settings);
     }
 
     private class SelectedLanguageListener implements ActionListener {
 
         /**
-         * The current import.
-         */
-        private Import importInstance;
-
-        /**
          * The pane.
          */
         private JTabbedPane tab;
@@ -372,8 +383,7 @@
          * @param i The current import.
          * @param t The pane.
          */
-        SelectedLanguageListener(Import i, JTabbedPane t) {
-            importInstance = i;
+        SelectedLanguageListener(JTabbedPane t) {
             tab = t;
         }
 
@@ -388,11 +398,18 @@
             updateFilters((JFileChooser) dialog.getContentPane()
                     .getComponent(0), oldModule.getSuffixFilters(),
                     getCurrentModule().getSuffixFilters());
-            // TODO: Update configPanelExtension with extension settings
-            // for new language
-
+            updateTabbedPane();
+        }
+        
+        private void updateTabbedPane() {
+            String name = ((ModuleInterface) getCurrentModule()).getName();
+            if (tab.indexOfTab(name) < 0) {
+                tab.add(getConfigPanelExtension(), name);
+            }
         }
     }
+    
+
 
     /**
      * Parse all selected files. It calls the actual parser methods depending on
@@ -578,7 +595,7 @@
             File[] files = getSelectedFiles();
             File dir = getCurrentDirectory();
             if (files.length == 0) {
-                files = new File[] {dir };
+                files = new File[] {dir};
             }
             if (files.length == 1) {
                 File file = files[0];
@@ -592,14 +609,7 @@
             Globals.setLastDirectory(dir.getPath());
             theImport.disposeDialog();
 
-            if (theImport.getCurrentModule() 
-                    instanceof ExtendedImportInterface) {
-                ExtendedImportInterface eii = 
-                    (ExtendedImportInterface) theImport.getCurrentModule();
-                eii.invokeImport(new ImportCommand(theImport));
-            } else {
-                theImport.doFile();
-            }
+            theImport.doFile();
         }
 
         /*
@@ -613,9 +623,142 @@
     }
 
     /**
-     * @return Returns the Frame.
+     * Extended configuration panel for file import.  Built based on settings
+     * requested by the specific language importer.
      */
-    public Frame getFrame() {
-        return myFrame;
+    class ConfigPanelExtension extends JPanel {
+
+
+        /**
+         * Construct the configuration extension panel.
+         * @param settings A list of settings requested by the language importer
+         */
+        public ConfigPanelExtension(final List<Setting> settings) {
+
+            setLayout(new GridBagLayout());
+            
+            if (settings == null || settings.size() == 0) {
+                JLabel label = new JLabel("No settings for this importer");
+                add(label, createGridBagConstraints(true, false, false));
+                add(new JPanel(), createGridBagConstraintsFinal()); 
+                return;
+            }
+
+            for (Setting setting : settings) {
+                if (setting instanceof UniqueSelection2) {
+                    JLabel label = new JLabel(setting.getLabel());
+                    add(label, createGridBagConstraints(true, false, false));
+
+                    final UniqueSelection2 us = (UniqueSelection2) setting;
+                    ButtonGroup group = new ButtonGroup();
+                    int count = 0;
+                    for (String option : us.getOptions()) {
+                        JRadioButton button = new JRadioButton(option);
+                        final int index = count++;
+                        if (us.getDefaultSelection() == index) {
+                            button.setSelected(true);
+                        }
+                        group.add(button);
+                        button.addActionListener(new ActionListener() {
+                            public void actionPerformed(ActionEvent e) {
+                                us.setSelection(index);
+                            }
+                        });
+                        add(button, createGridBagConstraints(false, false,
+                                false));
+                    }
+                } else if (setting instanceof UserString2) {
+                    JLabel label = new JLabel(setting.getLabel());
+                    add(label, createGridBagConstraints(true, false, false));
+                    final UserString2 us = (UserString2) setting;
+                    final JTextField text = 
+                        new JTextField(us.getDefaultString());
+                    text.addFocusListener(new FocusListener() {
+                        public void focusGained(FocusEvent e) { } 
+                        public void focusLost(FocusEvent e) {
+                            us.setUserString(text.getText());           
+                        }
+                        
+                    });
+                    add(text, createGridBagConstraints(true, false, false));
+                } else if (setting instanceof BooleanSelection2) {
+                    final BooleanSelection2 bs = (BooleanSelection2) setting;
+                    final JCheckBox button = new JCheckBox(setting.getLabel());
+                    button.setEnabled(bs.isSelected());
+                    button.addActionListener(new ActionListener() {
+                        public void actionPerformed(ActionEvent e) {
+                            bs.setSelected(button.isSelected());
+                        }
+                    });
+                    add(button, createGridBagConstraints(true, false, false));
+                } else if (setting instanceof PathSelection) {
+                    JLabel label = new JLabel(setting.getLabel());
+                    add(label, createGridBagConstraints(true, false, false));
+                    PathSelection ps = (PathSelection) setting;
+                    // TODO: Need to add FileChooser 
+                    JTextField text = new JTextField(ps.getDefaultPath());
+                    add(text, createGridBagConstraints(true, false, false));
+                    // TODO: Update setting
+                } else if (setting instanceof PathListSelection) {
+                    PathListSelection pls = (PathListSelection) setting;
+                    add(new ImportClasspathDialog(pls),
+                            createGridBagConstraints(true, false, false));
+                } else {
+                    throw new RuntimeException("Unknown setting type requested "
+                            + setting);
+                }
+            }
+            add(new JPanel(), createGridBagConstraintsFinal()); 
+        }
+
+
+        /**
+         * Create a GridBagConstraints object to use with the layout.
+         * 
+         * @param topInset true to use a top inset 
+         * @param bottomInset true to use a bottom inset
+         * @param fill true to fill (horizontally)
+         * @return the grid bag constraints
+         */
+        private GridBagConstraints createGridBagConstraints(boolean topInset,
+                boolean bottomInset, boolean fill) {
+            GridBagConstraints gbc = new GridBagConstraints();
+            gbc.gridx = GridBagConstraints.RELATIVE;
+            gbc.gridy = GridBagConstraints.RELATIVE;
+            gbc.gridwidth = GridBagConstraints.REMAINDER;
+            gbc.gridheight = 1;
+            gbc.weightx = 1.0;
+            gbc.weighty = 0.0;
+            gbc.anchor = GridBagConstraints.NORTHWEST;
+            gbc.fill = fill ? GridBagConstraints.HORIZONTAL
+                    : GridBagConstraints.NONE;
+            gbc.insets = 
+                new Insets(
+                        topInset ? 5 : 0, 
+                                5, 
+                                bottomInset ? 5 : 0, 
+                                        5);
+            gbc.ipadx = 0;
+            gbc.ipady = 0;
+            return gbc;
+        }
+
+        /**
+         * A GridBagConstraints for the last item to take up the rest of the
+         * space.
+         * 
+         * @return the GridBagConstraints object
+         */
+        private GridBagConstraints createGridBagConstraintsFinal() {
+            GridBagConstraints gbc = createGridBagConstraints(false, true,
+                    false);
+            gbc.gridheight = GridBagConstraints.REMAINDER;
+            gbc.weighty = 1.0;
+            return gbc;
+        }
+
     }
+
+
+
 }

Modified: trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportClassLoader.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportClassLoader.java?view=diff&rev=15041&p1=trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportClassLoader.java&p2=trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportClassLoader.java&r1=15040&r2=15041
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportClassLoader.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportClassLoader.java	2008-06-22 15:03:27-0700
@@ -124,7 +124,7 @@
     /**
      * There is no default constructor for URLClassloader, so we should provide
      * urls when creating the instance.
-     * We crate a new instance in this method.
+     * We create a new instance in this method.
      *
      * @param urls the URLs
      * @return the instance of this class

Removed: trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportCommand.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportCommand.java?view=auto&rev=15040

Removed: trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportCommandInterface.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportCommandInterface.java?view=auto&rev=15040

Modified: trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportCommon.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportCommon.java?view=diff&rev=15041&p1=trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportCommon.java&p2=trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportCommon.java&r1=15040&r2=15041
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportCommon.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportCommon.java	2008-06-22 15:03:27-0700
@@ -49,7 +49,6 @@
 import org.argouml.uml.diagram.ArgoDiagram;

 import org.argouml.uml.diagram.static_structure.ClassDiagramGraphModel;

 import org.argouml.uml.diagram.static_structure.layout.ClassdiagramLayouter;

-import org.argouml.uml.reveng.ImportInterface.ImportException;

 import org.tigris.gef.base.Globals;

 

 /**

@@ -124,13 +123,6 @@
     public abstract int getImportLevel();

 

 

-    /*

-     * @see org.argouml.uml.reveng.ImportSettings#getDiagramInterface()

-     */

-    public DiagramInterface getDiagramInterface() {

-        return diagramInterface;

-    }

-

     /**

      * Compute and cache the current diagram interface.

      */

@@ -158,22 +150,6 @@
      */

     public abstract String getInputSourceEncoding();

 

-    /*

-     * @see org.argouml.uml.reveng.ImportSettings#isAttributeSelected()

-     */

-    public abstract boolean isAttributeSelected();

-

-    /*

-     * @see org.argouml.uml.reveng.ImportSettings#isDatatypeSelected()

-     */

-    public abstract boolean isDatatypeSelected();

-

-    /*

-     * @see org.argouml.uml.reveng.ImportSettings#getImportSession()

-     */

-    public ImportCommon getImportSession() {

-        return this;

-    }

 

     /**

      * Get the files.  We generate it based on their specified

@@ -448,7 +424,10 @@
     /**

      * Gets the import classpaths. This should be asked by the GUI for

      * initialization.

+     * 

      * @return a list with Strings representing the classpaths

+     * @deprecated for 0.25.7 by tfmorris. This is a Java importer specific

+     *             method.

      */

     public List<String> getImportClasspath() {

         List<String> list = new ArrayList<String>();

@@ -471,15 +450,13 @@
      */

     public void layoutDiagrams(ProgressMonitor monitor, int startingProgress) {

 

-        // ArgoEclipse implementation

-        DiagramInterface di = getDiagramInterface();

-        if (di == null) {

+        if (diagramInterface == null) {

             return;

         }

 //        if (monitor != null) {

 //            monitor.updateSubTask(ImportsMessages.layoutingAction);

 //        }

-        List<ArgoDiagram> diagrams = di.getModifiedDiagramList();

+        List<ArgoDiagram> diagrams = diagramInterface.getModifiedDiagramList();

         int total = startingProgress + diagrams.size()

                 / 10;

         for (int i = 0; i < diagrams.size(); i++) {

@@ -542,7 +519,6 @@
      * @param filesLeft the files to parse

      * @param monitor the progress meter

      * @param progress the actual progress until now

-     * @throws ImportException exception thrown my import module

      */

     private void doImportInternal(List<File> filesLeft,

             final ProgressMonitor monitor, int progress) {


Modified: trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportInterface.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportInterface.java?view=diff&rev=15041&p1=trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportInterface.java&p2=trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportInterface.java&r1=15040&r2=15041
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportInterface.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportInterface.java	2008-06-22 15:03:27-0700
@@ -36,6 +36,9 @@
 /**

  * An interface which identifies an ArgoUML plug-in which imports 

  * source language modules and creates UML model elements in our model.

+ * <p>

+ * This interface is GUI independent and must not have any dependency on

+ * Swing/AWT or SWT.

  * 

  * @author Tom Morris

  * @since 0.23.2


Modified: trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportSettings.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportSettings.java?view=diff&rev=15041&p1=trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportSettings.java&p2=trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportSettings.java&r1=15040&r2=15041
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportSettings.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportSettings.java	2008-06-22 15:03:27-0700
@@ -1,5 +1,5 @@
 // $Id$

-// Copyright (c) 2006 The Regents of the University of California. All

+// Copyright (c) 2006-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

 // agreement is hereby granted, provided that the above copyright notice

@@ -58,33 +58,52 @@
      */

     public String getInputSourceEncoding();

 

-    // TODO: Change attribute and datatype to return a literal/enum

-    // instead? - tfm

-

     /**

-     * @return true if associations should be modeled as attributes

+     * @return always returns false.

+     * @deprecated for 0.25.6 by tfmorris.  This is a Java-specific setting

+     * that was inadvertantly included in the interface for 0.24.  Not 

+     * intended for public use.  Instead use the Settings interface to

+     * importer-specific settings.

      */

+    @Deprecated

     public boolean isAttributeSelected();

 

     /**

-     * @return true if arrays should be modeled as UML Datatypes

+     * @return always returns false.

+     * @deprecated for 0.25.6 by tfmorris.  This is a Java-specific setting

+     * that was inadvertantly included in the interface for 0.24.  Not 

+     * intended for public use.  Instead use the Settings interface to

+     * importer-specific settings.

      */

+    @Deprecated

     public boolean isDatatypeSelected();

 

     /**

-     * TODO: This should be removed when diagram updating removed from the 

-     * importers (as it should be). - tfm 20061129

      * @return true if the user has request diagrams to be created for packages

      *         contained in the imported source code.

+     * @deprecated for 0.25.6 by tfmorris. This is handled by the import

+     *             framework so specific importers don't need to worry about it.

+     */

+    /*

+     * NOTE: When this is removed from here, it should NOT be removed from

+     * ImportSettingsInternal to guarantee that GUI implementations are forced

+     * to implement it.

      */

+    @Deprecated

     public boolean isCreateDiagramsSelected();

     

     /**

-     * TODO: This should be removed when diagram updating removed from the 

-     * importers (as it should be). - tfm 20061129

      * @return true, if user has requested that new figures placed in diagrams

      *         should be minimized so they don't show internal compartments.

+     * @deprecated for 0.25.6 by tfmorris. This is handled by the import

+     *             framework so specific importers don't need to worry about it.

+     */

+    /*

+     * NOTE: When this is removed from here, it should NOT be removed from

+     * ImportSettingsInternal to guarantee that GUI implementations are forced

+     * to implement it.

      */

+    @Deprecated

     public boolean isMinimizeFigsSelected();

 

 


Modified: trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportSettingsInternal.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportSettingsInternal.java?view=diff&rev=15041&p1=trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportSettingsInternal.java&p2=trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportSettingsInternal.java&r1=15040&r2=15041
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportSettingsInternal.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportSettingsInternal.java	2008-06-22 15:03:27-0700
@@ -1,5 +1,5 @@
 // $Id$

-// Copyright (c) 2006 The Regents of the University of California. All

+// Copyright (c) 2006-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

 // agreement is hereby granted, provided that the above copyright notice

@@ -54,22 +54,16 @@
     public boolean isDiagramLayoutSelected();

 

     /**

-     * TODO: This should be moved from the superclass when diagram updating

-     * removed from the importers (as it should be). - tfm 20061129

-     * 

      * @return true if the user has request diagrams to be created for packages

      *         contained in the imported source code.

      */

-//    public boolean isCreateDiagramsSelected();

+    public boolean isCreateDiagramsSelected();

     

     /**

-     * TODO: This should be moved from the superclass when diagram updating

-     * removed from the importers (as it should be). - tfm 20061129

-     * 

      * @return true, if user has requested that new figures placed in diagrams

      *         should be minimized so they don't show internal compartments.

      */

-//    public boolean isMinimizeFigsSelected();

+    public boolean isMinimizeFigsSelected();

 

 

 }


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=15041&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=15040&r2=15041
==============================================================================
--- 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-22 15:03:27-0700
@@ -24,6 +24,7 @@
 

 package org.argouml.uml.reveng;

 

+import java.util.Collections;

 import java.util.List;

 

 

@@ -75,7 +76,7 @@
      * would be labeled checkbox.

      */

     public static class BooleanSelection extends Setting

-        implements SettingsTypes.BooleanSelection {

+        implements SettingsTypes.BooleanSelection2 {

 

         private boolean defaultValue;

         private boolean value;

@@ -106,36 +107,117 @@
         public final boolean getDefaultValue() {

             return defaultValue;

         }

+        

+        public final void setSelected(boolean selected) {

+            this.value = selected;

+        }

     }

     

+    /**

+     * A setting that allows a single selection from a list of choices.

+     * 

+     * @see SettingsTypes.UniqueSelection2

+     * @author Bogdan Pistol

+     * 

+     */

     public static class UniqueSelection extends Setting implements

-            SettingsTypes.UniqueSelection {

+            SettingsTypes.UniqueSelection2 {

 

+        /**

+         * The list of String options

+         */

         private List<String> options;

+        

+        /**

+         * Default selection is UNDEFINED

+         */

+        private int defaultSelection = UNDEFINED_SELECTION;

+        

+        /**

+         * The selection is UNDEFINED

+         */

+        private int selection = UNDEFINED_SELECTION;

+        

+        /**

+         * Constructor

+         * 

+         * @param label the user visible string to associate with this setting

+         * @param variants

+         *            the list of String options

+         * @param defaultVariant

+         *            the default selection or UNDEFINED_SELECTION

+         */

+        public UniqueSelection(String label, List<String> variants,

+                int defaultVariant) {

+            super(label);

+            options = variants;

+            if (isOption(defaultVariant)) {

+                defaultSelection = defaultVariant;

+            }

+        }

 

-        private int selection;

-

-        public UniqueSelection(String labelText, List<String> optionLabels,

-                int defaultSelection) {

-            super(labelText);

-            options = optionLabels;

-            this.selection = selection;

+        /**

+         * Tests if this is a valid option.

+         * 

+         * @param opt

+         *            the option to test

+         * @return true if it's OK and false otherwise

+         */

+        private boolean isOption(int opt) {

+            if (options == null) {

+                return false;

+            }

+            return opt >= 0 && opt < options.size() ? true : false;        

         }

 

+        /*

+         * @see org.argouml.uml.reveng.ImportSettingTypes.UniqueSelection#getDefaultSelection()

+         */

         public int getDefaultSelection() {

-            return selection;

+            return defaultSelection;

         }

 

+        /*

+         * We return a new List with the options instead of the options themself

+         * because we don't want the user to be able to change the options.

+         * 

+         * @see org.argouml.uml.reveng.SettingsTypes.UniqueSelection#getOptions()

+         */

         public List<String> getOptions() {

-            return options;

+            return Collections.unmodifiableList(options);

         }

 

-        public boolean setSelection(int selection) {

-            this.selection = selection;

-            return true;

+        /*

+         * @see org.argouml.uml.reveng.ImportSettingTypes.UniqueSelection#setSelection(int)

+         */

+        public boolean setSelection(int sel) {

+            if (isOption(sel)) {

+                selection = sel;

+                return true;

+            } else {

+                return false;

+            }

         }

+        

+        /**

+         * This method (package access) determines the selected option.

+         * 

+         * @return the 0-based index of the selected option or the default

+         *         option if no other option was selected

+         */

+        public int getSelection() {

+            if (selection == UNDEFINED_SELECTION) {

+                return defaultSelection;

+            } else {

+                return selection;

+            }

+        }

+

     }

 

+    /**

+     * A selection for a single path (e.g. file system path or directory).

+     */

     public static class PathSelection extends Setting implements

             SettingsTypes.PathSelection {

 

@@ -143,11 +225,19 @@
 

         private String defaultPath;

 

+        /**

+         * Construct a PathSelection with the given attributes.

+         * 

+         * @param labelText string to use for the label of the path list

+         * @param descriptionText longer description of the purpose of this

+         *                pathlist (appropriate for a tooltip)

+         * @param defaultValue initial value of the path 

+         */

         public PathSelection(String labelText, String descriptionText,

-                String defaultPath) {

+                String defaultValue) {

             super(labelText, descriptionText);

-            this.defaultPath = defaultPath;

-            path = defaultPath;

+            defaultPath = defaultValue;

+            path = defaultValue;

         }

 

         public String getDefaultPath() {

@@ -169,6 +259,9 @@
 

     }

 

+    /**

+     * An implementation of the PathListSelection.

+     */

     public static class PathListSelection extends Setting implements

             SettingsTypes.PathListSelection {

 

@@ -176,11 +269,19 @@
 

         private List<String> pathList;

 

+        /**

+         * Construct a new PathListSelection with the given attributes.

+         * 

+         * @param labelText string to use for the label of the path list

+         * @param descriptionText longer description of the purpose of this

+         *                pathlist (appropriate for a tooltip)

+         * @param defaultList inital values of the path list

+         */

         public PathListSelection(String labelText, String descriptionText,

-                List<String> defaultPathList) {

+                List<String> defaultList) {

             super(labelText, descriptionText);

-            this.defaultPathList = defaultPathList;

-            pathList = defaultPathList;

+            defaultPathList = defaultList;

+            pathList = defaultList;

         }

 

         public List<String> getDefaultPathList() {

@@ -191,6 +292,10 @@
             return pathList;

         }

 

+        public void setPathList(List<String> newPathList) {

+            pathList = newPathList;

+        }

+

     }

 

 }
\ No newline at end of file

Removed: trunk/src/argouml-app/src/org/argouml/uml/reveng/SettingUniqueSelection.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/reveng/SettingUniqueSelection.java?view=auto&rev=15040

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=15041&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=15040&r2=15041
==============================================================================
--- 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-22 15:03:27-0700
@@ -105,6 +105,18 @@
          *         bounds

          */

         boolean setSelection(int selection);

+        

+        /**

+         * @return the current selection

+         */

+        int getSelection();

+    }

+    

+    /**

+     * A UniqueSelection which includes a description.

+     * @see UniqueSelection

+     */

+    interface UniqueSelection2 extends UniqueSelection, Setting2 {

     }

     

     /**

@@ -115,10 +127,27 @@
          * @return the initial string to display, if any.  May be null.

          */

         String getDefaultString();

+        

         /**

          * @return the user entered string

          */

         String getUserString();

+        

+        /**

+         * Set user string to new value.

+         * 

+         * @param userString new user string

+         */

+        void setUserString(String userString);

+        

+    }

+    

+    /**

+     * A UserString which includes a description.

+     * @see UserString

+     */

+    interface UserString2 extends UserString, Setting2 {

+        

     }

     

     /**

@@ -133,6 +162,20 @@
          * @return the user selected value

          */

         boolean isSelected();

+        

+        /**

+         * Set the selection value.

+         * @param selected boolean indicating new state of selection

+         */

+        void setSelected(boolean selected);

+    }

+    

+    /**

+     * A BooleanSelection which includes a description.

+     * @see BooleanSelection

+     */

+    interface BooleanSelection2 extends BooleanSelection, Setting2 {

+        

     }

     

     /**

@@ -149,6 +192,12 @@
          * @return the user selected path

          */

         String getPath();

+        

+        /**

+         * Set the path to the given value

+         * @param path new value of the path

+         */

+        void setPath(String path);

     }

     

     /**

@@ -166,6 +215,13 @@
          * @return the user selected ordered list of file system paths

          */

         List<String> getPathList();

+        

+        /**

+         * Set the path list to the new values.

+         * 

+         * @param pathList new list of paths

+         */

+        void setPathList(List<String> pathList);

     }

 

 }


Modified: trunk/src/argouml-app/src/org/argouml/uml/reveng/java/JavaImport.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/reveng/java/JavaImport.java?view=diff&rev=15041&p1=trunk/src/argouml-app/src/org/argouml/uml/reveng/java/JavaImport.java&p2=trunk/src/argouml-app/src/org/argouml/uml/reveng/java/JavaImport.java&r1=15040&r2=15041
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/reveng/java/JavaImport.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/reveng/java/JavaImport.java	2008-06-22 15:03:27-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2007 The Regents of the University of California. All
+// Copyright (c) 1996-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
 // agreement is hereby granted, provided that the above copyright notice
@@ -32,21 +32,27 @@
 import java.io.PrintWriter;
 import java.io.StringWriter;
 import java.io.UnsupportedEncodingException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 
 import org.apache.log4j.Logger;
+import org.argouml.application.api.Argo;
+import org.argouml.configuration.Configuration;
+import org.argouml.configuration.ConfigurationKey;
 import org.argouml.i18n.Translator;
 import org.argouml.kernel.Project;
 import org.argouml.taskmgmt.ProgressMonitor;
-import org.argouml.uml.reveng.ExtendedImportInterface;
 import org.argouml.uml.reveng.FileImportUtils;
-import org.argouml.uml.reveng.ImportCommandInterface;
+import org.argouml.uml.reveng.ImportClassLoader;
+import org.argouml.uml.reveng.ImportInterface;
 import org.argouml.uml.reveng.ImportSettings;
 import org.argouml.uml.reveng.ImporterManager;
-import org.argouml.uml.reveng.ui.ImportClasspathDialog;
+import org.argouml.uml.reveng.Setting;
+import org.argouml.uml.reveng.SettingsTypes;
 import org.argouml.util.FileFilters;
 import org.argouml.util.SuffixFilter;
 
@@ -54,30 +60,92 @@
  * This is the main class for Java reverse engineering. It's based
  * on the Antlr Java example.
  *
- * @author Andreas Rueckert, Thomas Neustupny
+ * @author Andreas Rueckert
+ * @author Thomas Neustupny
  */
-public class JavaImport implements ExtendedImportInterface {
+public class JavaImport implements ImportInterface {
 
     /** logger */
     private static final Logger LOG = Logger.getLogger(JavaImport.class);
+
+    
+    /**
+     * Key for RE extended settings: model attributes as:
+     * 0: attributes
+     * 1: associations
+     */
+    public static final ConfigurationKey KEY_IMPORT_EXTENDED_MODEL_ATTR =
+        Configuration
+            .makeKey("import", "extended", "java", "model", "attributes");
+
+    /**
+     * Key for RE extended settings: model arrays as:
+     * 0: datatype
+     * 1: associations
+     */
+    public static final ConfigurationKey KEY_IMPORT_EXTENDED_MODEL_ARRAYS =
+        Configuration.makeKey("import", "extended", "java", "model", "arrays");
+
+    /**
+     * Key for RE extended settings: flag for modeling of listed collections,
+     * if to model them as associations with multiplicity *.
+     */
+    public static final ConfigurationKey KEY_IMPORT_EXTENDED_COLLECTIONS_FLAG =
+        Configuration
+            .makeKey("import", "extended", "java", "collections", "flag");
+
+    /**
+     * Key for RE extended settings: list of collections, that will be modelled
+     * as associations with multiplicity *.
+     */
+    public static final ConfigurationKey KEY_IMPORT_EXTENDED_COLLECTIONS_LIST =
+        Configuration
+            .makeKey("import", "extended", "java", "collections", "list");
+
+    /**
+     * Key for RE extended settings: flag for modelling of listed collections,
+     * if to model them as ordered associations with multiplicity *.
+     */
+    public static final ConfigurationKey KEY_IMPORT_EXTENDED_ORDEREDCOLLS_FLAG =
+        Configuration
+            .makeKey("import", "extended", "java", "orderedcolls", "flag");
+
+    /**
+     * Key for RE extended settings: list of collections, that will be modelled
+     * as ordered associations with multiplicity *.
+     */
+    public static final ConfigurationKey KEY_IMPORT_EXTENDED_ORDEREDCOLLS_LIST =
+        Configuration
+            .makeKey("import", "extended", "java", "orderedcolls", "list");
+
     
     /**
      * New model elements that were added
      */
     private Collection newElements;
+
+    private List<SettingsTypes.Setting> settingsList;
+    private SettingsTypes.UniqueSelection2 attributeSetting;
+    private SettingsTypes.UniqueSelection2 datatypeSetting;
+    private SettingsTypes.PathListSelection pathlistSetting;
     
+
     /*
      * @see org.argouml.uml.reveng.ImportInterface#parseFiles(org.argouml.kernel.Project, java.util.Collection, org.argouml.uml.reveng.ImportSettings, org.argouml.application.api.ProgressMonitor)
      */
-    public Collection parseFiles(Project p, Collection files,
+    public Collection parseFiles(Project p, Collection<File> files,
             ImportSettings settings, ProgressMonitor monitor)
         throws ImportException {
 
+        saveSettings();
+        updateImportClassloader();
         newElements = new HashSet();
         monitor.updateMainTask(Translator.localize("dialog.import.pass1"));
         try {
-            if (settings.getImportLevel() == ImportSettings.DETAIL_CLASSIFIER_FEATURE
-                    || settings.getImportLevel() == ImportSettings.DETAIL_FULL) {
+            if (settings.getImportLevel() 
+                        == ImportSettings.DETAIL_CLASSIFIER_FEATURE
+                    || settings.getImportLevel() 
+                        == ImportSettings.DETAIL_FULL) {
                 monitor.setMaximumProgress(files.size() * 2);
                 doImportPass(p, files, settings, monitor, 0, 0);
                 if (!monitor.isCanceled()) {
@@ -95,43 +163,45 @@
         return newElements;
     }
 
+    private void saveSettings() {
+        Configuration.setString(KEY_IMPORT_EXTENDED_MODEL_ATTR, String
+                .valueOf(attributeSetting.getSelection()));
+        Configuration.setString(KEY_IMPORT_EXTENDED_MODEL_ARRAYS, String
+                .valueOf(datatypeSetting.getSelection()));
+    }
 
-    private void doImportPass(Project p, Collection files,
+    private void doImportPass(Project p, Collection<File> files,
             ImportSettings settings, ProgressMonitor monitor, int startCount,
-            int pass) throws ImportException {
+            int pass) {
         
         int count = startCount;
-        for (Iterator it = files.iterator(); it.hasNext();) {
+        for (File file : files) {
             if (monitor.isCanceled()) {
                 monitor.updateSubTask(
                         Translator.localize("dialog.import.cancelled"));
                 return;
             }
-            Object file = it.next();
-            if (file instanceof File) {
-                try {
-                    parseFile(p, (File) file, settings, pass);
-                } catch (Exception e) {
-                    StringWriter sw = new StringWriter();
-                    PrintWriter pw = new java.io.PrintWriter(sw);
-                    e.printStackTrace(pw);
-                    monitor.notifyMessage(
+            try {
+                parseFile(p, file, settings, pass);
+            } catch (Exception e) {
+                StringWriter sw = new StringWriter();
+                PrintWriter pw = new java.io.PrintWriter(sw);
+                e.printStackTrace(pw);
+                monitor.notifyMessage(
+                    Translator.localize(
+                        "dialog.title.import-problems"), //$NON-NLS-1$
                         Translator.localize(
-                            "dialog.title.import-problems"), //$NON-NLS-1$
-                            Translator.localize(
-                            "label.import-problems"),        //$NON-NLS-1$
-                            sw.toString());
-                    if (monitor.isCanceled()) {
-                        break;
-                    }
+                        "label.import-problems"),        //$NON-NLS-1$
+                        sw.toString());
+                if (monitor.isCanceled()) {
+                    break;
                 }
-                monitor.updateProgress(count++);
-                monitor.updateSubTask(Translator.localize(
-                        "dialog.import.parsingAction",
-                        new Object[] {((File) file).getAbsolutePath()}));
-            } else {
-                throw new ImportException("Object isn't a file " + file);
             }
+            monitor.updateProgress(count++);
+            monitor.updateSubTask(Translator.localize(
+                    "dialog.import.parsingAction",
+                    new Object[] {file.getAbsolutePath()}));
+
         }
 
         return;
@@ -187,7 +257,7 @@
 
             // Create a modeller for the parser
             Modeller modeller = new Modeller(p.getModel(),
-                    settings,
+                    isAttributeSelected(),isDatatypeSelected(),
                     f.getName());
 
             // Print the name of the current file, so we can associate
@@ -225,7 +295,7 @@
     }
 
 
-    /**
+    /*
      * @see org.argouml.uml.reveng.ImportInterface#getSuffixFilters()
      */
     public SuffixFilter[] getSuffixFilters() {
@@ -233,13 +303,6 @@
 	return result;
     }
 
-    /**
-     * @see org.argouml.uml.reveng.ExtendedImportInterface#invokeImport(org.argouml.uml.reveng.ImportCommandInterface)
-     */
-    public void invokeImport(ImportCommandInterface importCmd) {
-        new ImportClasspathDialog(importCmd);
-    }
-
     /*
      * @see org.argouml.uml.reveng.ImportInterface#isParseable(java.io.File)
      */
@@ -282,22 +345,107 @@
      * @see org.argouml.moduleloader.ModuleInterface#enable()
      */
     public boolean enable() {
-        init();
+	ImporterManager.getInstance().addImporter(this);
         return true;
     }
 
+    
+    /*
+     * @see org.argouml.uml.reveng.ImportInterface#getImportSettings()
+     */
+    public List<SettingsTypes.Setting> getImportSettings() {
+        
+        settingsList = new ArrayList<SettingsTypes.Setting>();
+
+        // Settings from ConfigPanelExtension
+
+        // TODO: These properties should move out of the core into someplace
+        // specific to the Java importer
+        List<String> options = new ArrayList<String>();
+        options.add(Translator.localize("action.import-java-UML-attr"));
+        options.add(Translator.localize("action.import-java-UML-assoc"));
+
+        int selected;
+        String modelattr = Configuration
+                .getString(KEY_IMPORT_EXTENDED_MODEL_ATTR);
+        selected = Integer.parseInt(modelattr);
+
+        attributeSetting = new Setting.UniqueSelection(Translator
+                .localize("action.import-java-attr-model"), options,
+                selected);
+        settingsList.add(attributeSetting);
+
+        options.clear();
+        options.add(Translator
+                .localize("action.import-java-array-model-datatype"));
+        options.add(Translator
+                .localize("action.import-java-array-model-multi"));
+
+        String modelarrays = Configuration
+                .getString(KEY_IMPORT_EXTENDED_MODEL_ARRAYS);
+        selected = Integer.parseInt(modelarrays);
+
+        datatypeSetting = new Setting.UniqueSelection(Translator
+                .localize("action.import-java-array-model"), options,
+                selected);
+        settingsList.add(datatypeSetting);
+
+        List<String> paths = new ArrayList<String>();
+        URL[] urls = ImportClassLoader.getURLs(Configuration.getString(
+                Argo.KEY_USER_IMPORT_CLASSPATH, ""));
+
+        for (URL url : urls) {
+            paths.add(url.getFile());
+        }
+        pathlistSetting = new Setting.PathListSelection(Translator
+                .localize("dialog.import.classpath.title"), Translator
+                .localize("dialog.import.classpath.text"), paths);
+        settingsList.add(pathlistSetting);
+
+        
+        return settingsList;
+    }
+    
+
+    public void updateImportClassloader() {
+        List<String> pathList = pathlistSetting.getPathList();
+        URL[] urls = new URL[pathList.size()];
+
+        int i = 0;
+        for (String path : pathlistSetting.getPathList()) {
+            try {
+                urls[i++] = new File(path).toURI().toURL();
+            } catch (MalformedURLException e) {
+                LOG.error("Bad path in classpath " + path);
+            }
+        }
+
+        try {
+            ImportClassLoader.getInstance(urls);
+            ImportClassLoader.getInstance().saveUserPath();
+        } catch (MalformedURLException e) {
+
+        }
+    }
+
     /**
-     * Enable the importer.
+     * Only intended for use in the Java classfile importer.
+     * 
+     * @return true if references should be modeled as UML Attributes instead of
+     *         UML Associations.
      */
-    public void init() {
-	ImporterManager.getInstance().addImporter(this);
+    public boolean isAttributeSelected() {        
+        return attributeSetting.getSelection() == 0;
     }
     
-    /*
-     * @see org.argouml.uml.reveng.ImportInterface#getImportSettings()
+    /**
+     * Only intended for use in the Java classfile importer
+     * 
+     * @return true if arrays should be modeled as datatypes instead of using
+     *         UML's multiplicities.
      */
-    public List getImportSettings() {
-        return null;
+    public boolean isDatatypeSelected() {
+        return datatypeSetting.getSelection() == 0;
     }
 
 }

Modified: trunk/src/argouml-app/src/org/argouml/uml/reveng/java/Modeller.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/reveng/java/Modeller.java?view=diff&rev=15041&p1=trunk/src/argouml-app/src/org/argouml/uml/reveng/java/Modeller.java&p2=trunk/src/argouml-app/src/org/argouml/uml/reveng/java/Modeller.java&r1=15040&r2=15041
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/reveng/java/Modeller.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/reveng/java/Modeller.java	2008-06-22 15:03:27-0700
@@ -43,7 +43,6 @@
 import org.argouml.ocl.OCLUtil;
 import org.argouml.uml.reveng.ImportCommon;
 import org.argouml.uml.reveng.ImportInterface;
-import org.argouml.uml.reveng.ImportSettings;
 
 /**
  * Modeller maps Java source code(parsed/recognised by ANTLR) to UML model
@@ -139,7 +138,6 @@
      */
     private boolean generateNames = true;
     
-
     /**
      * Create a new modeller.
      *
@@ -147,11 +145,12 @@
      * @param settings the settings to use for this import
      * @param theFileName the current file name
      */
-    public Modeller(Object theModel, ImportSettings settings, 
+    public Modeller(Object theModel, boolean attributeSelected,
+            boolean datatypeSelected,
             String theFileName) {
         model = theModel;
-        noAssociations = settings.isAttributeSelected();
-        arraysAsDatatype = settings.isDatatypeSelected();
+        noAssociations = attributeSelected;
+        arraysAsDatatype = datatypeSelected;
         currentPackage = this.model;
         newElements = new HashSet<Object>();
         parseState = new ParseState(this.model, getPackage(JAVA_PACKAGE));
@@ -794,6 +793,7 @@
                          short modifiers,
                          String javadoc,
                          boolean forceIt) {
+        // TODO: Not implemented
         logError( "Java 5 annotation definitions not supported", "@" + name);
     }
     
@@ -803,6 +803,7 @@
      * @param name identifier for annotation.
      */
     void addAnnotation(String name) {
+        // TODO: Not implemented
         logError( "Java 5 annotations not supported", "@" + name);
     }
 

Modified: trunk/src/argouml-app/src/org/argouml/uml/reveng/ui/ImportClasspathDialog.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/reveng/ui/ImportClasspathDialog.java?view=diff&rev=15041&p1=trunk/src/argouml-app/src/org/argouml/uml/reveng/ui/ImportClasspathDialog.java&p2=trunk/src/argouml-app/src/org/argouml/uml/reveng/ui/ImportClasspathDialog.java&r1=15040&r2=15041
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/reveng/ui/ImportClasspathDialog.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/reveng/ui/ImportClasspathDialog.java	2008-06-22 15:03:27-0700
@@ -1,162 +1,125 @@
+// $Id$
+// Copyright (c) 1996-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
+// agreement is hereby granted, provided that the above copyright notice
+// and this paragraph appear in all copies.  This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason.  IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
 package org.argouml.uml.reveng.ui;
 
 import java.awt.BorderLayout;
-import java.awt.Dimension;
 import java.awt.Frame;
 import java.awt.GridLayout;
-import java.awt.Toolkit;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.io.File;
-import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
 
 import javax.swing.DefaultListModel;
 import javax.swing.JButton;
-import javax.swing.JDialog;
 import javax.swing.JFileChooser;
+import javax.swing.JLabel;
 import javax.swing.JList;
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
-import javax.swing.JTextArea;
 
-import org.apache.log4j.Logger;
-import org.argouml.application.api.Argo;
-import org.argouml.configuration.Configuration;
 import org.argouml.i18n.Translator;
-import org.argouml.uml.reveng.ImportClassLoader;
-import org.argouml.uml.reveng.ImportCommandInterface;
+import org.argouml.uml.reveng.SettingsTypes.PathListSelection;
 import org.tigris.gef.base.Globals;
 
 /**
- * dialog to setup the import classpath.
+ * Panel to collect a list of paths for an importer. <em>NOTE:</em> Although
+ * this class is public it is <em>only</em> intended for use by the package
+ * org.argouml.reveng.
+ * <p>
+ * This was originally included in Import.java and was called
+ * ImportClasspathDialog.
  */
-public class ImportClasspathDialog extends JDialog {
+public class ImportClasspathDialog extends JPanel {
 
-    /**
-     * Logger.
-     */
-    private static final Logger LOG =
-        Logger.getLogger(ImportClasspathDialog.class);
-
-    private JDialog importClasspathDialog;
     private JList paths;
+
     private DefaultListModel pathsModel;
 
-    private JButton addFile;
+    private JButton addButton;
 
-    private JButton removeFile;
+    private JButton removeButton;
 
-    private JButton ok;
+    private JFileChooser chooser;
+    
+    private PathListSelection setting;
 
-    private ImportCommandInterface importCmd;
 
     /**
-     * Construct a dialog to allow the user to set up the classpath for the
-     * import.<p>
-     * @param impCmd 
+     * Construct a panel which provides controls for populating a list of 
+     * paths.  This can be used for a Java classpath, C++ include path, etc.
+     * 
+     * @param pathListSetting the settings object for this pathlist
      */
-    public ImportClasspathDialog(ImportCommandInterface impCmd) {
-
+    public ImportClasspathDialog(PathListSelection pathListSetting) {
         super();
-        importClasspathDialog = this;
-        setTitle(Translator.localize("dialog.import.classpath.title"));
-        importCmd = impCmd;
-
-        Dimension scrSize = Toolkit.getDefaultToolkit().getScreenSize();
-        getContentPane().setLayout(new BorderLayout(0, 0));
-
-        // Explanatory text
-        JTextArea ta =
-                new JTextArea(Translator
-                        .localize("dialog.import.classpath.text"));
-        ta.setLineWrap(true);
-        ta.setWrapStyleWord(true);
-        ta.setFocusable(false);
-        getContentPane().add(ta, BorderLayout.NORTH);
+        setting = pathListSetting;
+        setToolTipText(setting.getDescription());
+        
+        setLayout(new BorderLayout(0, 0));
+
+        JLabel label = new JLabel(setting.getLabel());
+        add(label, BorderLayout.NORTH);
 
-        // paths list
         pathsModel = new DefaultListModel();
+        for (String path : setting.getDefaultPathList()) {
+            pathsModel.addElement(path);
+        }
+        
         paths = new JList(pathsModel);
         paths.setVisibleRowCount(5);
+        paths.setToolTipText(setting.getDescription());
         JScrollPane listScroller = new JScrollPane(paths);
-        listScroller.setPreferredSize(new Dimension(300, 100));
-        getContentPane().add(listScroller, BorderLayout.CENTER);
-
-        initList();
+        add(listScroller, BorderLayout.CENTER);
 
-        // controls
+        // panel for controls
         JPanel controlsPanel = new JPanel();
-        controlsPanel.setLayout(new GridLayout(0, 3));
-        addFile = new JButton(Translator.localize("button.add"));
-        removeFile = new JButton(Translator.localize("button.remove"));
-        ok = new JButton(Translator.localize("button.ok"));
-        controlsPanel.add(addFile);
-        controlsPanel.add(removeFile);
-        controlsPanel.add(ok);
-        getContentPane().add(controlsPanel, BorderLayout.SOUTH);
-
-        addFile.addActionListener(new AddListener());
-        removeFile.addActionListener(new RemoveListener());
-        ok.addActionListener(new OkListener());
-
-        //Display the window.
-        Dimension contentPaneSize = getContentPane().getPreferredSize();
-        setLocation(scrSize.width / 2 - contentPaneSize.width / 2,
-            scrSize.height / 2 - contentPaneSize.height / 2);
-        pack();
-        ok.requestFocusInWindow();
-        setVisible(true);
-        this.setModal(true);        //MVW   Issue 2539.
+        controlsPanel.setLayout(new GridLayout(0, 2, 50, 0));
+        
+        addButton = new JButton(Translator.localize("button.add"));
+        controlsPanel.add(addButton);
+        addButton.addActionListener(new AddListener());
+        
+        removeButton = new JButton(Translator.localize("button.remove"));
+        controlsPanel.add(removeButton);
+        removeButton.addActionListener(new RemoveListener());
+        
+        // TODO: Add Up/Down buttons to control the ordering of items
+        
+        add(controlsPanel, BorderLayout.SOUTH);
     }
 
-    private void initList() {
-
-        URL[] urls =
-            ImportClassLoader.getURLs(Configuration.getString(
-                Argo.KEY_USER_IMPORT_CLASSPATH, ""));
-
-        for (int i = 0; i < urls.length; i++) {
-            pathsModel.addElement(urls[i].getFile());
-        }
-
-        paths.setSelectedIndex(0);
-    }
-
-
-    class OkListener implements ActionListener {
-        /*
-         * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
-         */
-        public void actionPerformed(ActionEvent e) {
-            try {
-                URL[] urls = new URL[pathsModel.size()];
-                for (int i = 0; i < urls.length; i++) {
-                    try {
-                        urls[i] = new File((String) pathsModel.get(i)).toURI()
-                                .toURL();
-                    } catch (Exception e1) {
-                        LOG.warn("could not do ok: could not make"
-                                + "url " + pathsModel.get(i) + ", " + e1,
-                                e1);
-                    }
-                }
 
-                try {
-                    ImportClassLoader.getInstance(urls);
-                    ImportClassLoader.getInstance().saveUserPath();
-                } catch (Exception e1) {
-                    LOG.warn("could not do ok", e1);
-                }
-                setVisible(false);
-                setModal(false);
-                dispose();
-                importCmd.execute();
-            } finally {
-                setVisible(false);
-                setModal(false);
-                dispose();
-            }
+    private void updatePathList() {
+        List<String> pathList = new ArrayList<String>();
+        for (int i = 0; i < pathsModel.size(); i++) {
+            String path = (String) pathsModel.getElementAt(i);
+            pathList.add(path);
         }
+        setting.setPathList(pathList);
     }
 
     class RemoveListener implements ActionListener {
@@ -168,12 +131,16 @@
             //there's a valid selection
             //so go ahead and remove whatever's selected.
             int index = paths.getSelectedIndex();
+            if (index < 0) {
+                return;
+            }
             pathsModel.remove(index);
+            updatePathList();
 
             int size = pathsModel.getSize();
 
             if (size == 0) { //nothings left, disable firing.
-                removeFile.setEnabled(false);
+                removeButton.setEnabled(false);
 
             } else { //Select an index.
                 if (index == pathsModel.getSize()) {
@@ -185,6 +152,7 @@
                 paths.ensureIndexIsVisible(index);
             }
         }
+
     }
 
 
@@ -194,41 +162,37 @@
          */
         public void actionPerformed(ActionEvent e) {
 
-            String directory = Globals.getLastDirectory();
-            JFileChooser ch = new JFileChooser(directory);
-            if (ch == null) {
-                ch = new JFileChooser();
-            }
-
-            final JFileChooser chooser = ch;
+            if (chooser == null ) {
+                chooser = new JFileChooser(Globals.getLastDirectory()); 
+                if (chooser == null) {
+                    chooser = new JFileChooser();
+                }
 
-            chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
-            chooser.setMultiSelectionEnabled(true);
-            chooser.addActionListener(new ActionListener() {
-                public void actionPerformed(ActionEvent e1) {
-                    if (e1.getActionCommand().equals(
-                            JFileChooser.APPROVE_SELECTION)) {
-                        File[] files = chooser.getSelectedFiles();
-                        for(File theFile : files) {
-                            if (theFile != null) {
-                                pathsModel.addElement(theFile.toString());
+                chooser.setFileSelectionMode(
+                        JFileChooser.FILES_AND_DIRECTORIES);
+                chooser.setMultiSelectionEnabled(true);
+                chooser.addActionListener(new ActionListener() {
+                    public void actionPerformed(ActionEvent e1) {
+                        if (e1.getActionCommand().equals(
+                                JFileChooser.APPROVE_SELECTION)) {
+                            File[] files = chooser.getSelectedFiles();
+                            for (File theFile : files) {
+                                if (theFile != null) {
+                                    pathsModel.addElement(theFile.toString());
+                                }
                             }
+                            updatePathList();
+                        } else if (e1.getActionCommand().equals(
+                                JFileChooser.CANCEL_SELECTION)) {
+                            // Just quit
                         }
-                    } else if (e1.getActionCommand().equals(
-                            JFileChooser.CANCEL_SELECTION)) {
-                        // TODO: What shall we do here?
+
                     }
-                    // bring the import classpath dialog to the front
-                    importClasspathDialog.setVisible(true);
-                }
-            });
+                });
+            }
 
             chooser.showOpenDialog(new Frame());
         }
     }
 
-    /**
-     * The UID.
-     */
-    private static final long serialVersionUID = -8684620532717336574L;
 }

Modified: trunk/src/argouml-app/src/org/argouml/uml/reveng/ui/RESequenceDiagramDialog.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/reveng/ui/RESequenceDiagramDialog.java?view=diff&rev=15041&p1=trunk/src/argouml-app/src/org/argouml/uml/reveng/ui/RESequenceDiagramDialog.java&p2=trunk/src/argouml-app/src/org/argouml/uml/reveng/ui/RESequenceDiagramDialog.java&r1=15040&r2=15041
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/reveng/ui/RESequenceDiagramDialog.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/reveng/ui/RESequenceDiagramDialog.java	2008-06-22 15:03:27-0700
@@ -190,7 +190,7 @@
             // TODO: must not depend on the Java modeller, but the needed one
             // must be either derived from the method's notation, or chosen by
             // the user from a list of available language importers
-            modeller = new Modeller(model, new DummySettings(), null);
+            modeller = new Modeller(model, true, true, null);
         } catch (Exception ex) { 
             // the only chance we have is to finish the current operation
             LOG.warn("Modeller not ready, so no more generation of calls", ex);
@@ -904,34 +904,4 @@
         return theClassifier;
     }
 
-    /**
-     * Fixed import settings class for our use.
-     */
-    private class DummySettings implements ImportSettings {
-
-        public int getImportLevel() {
-            return ImportSettings.DETAIL_CLASSIFIER;
-        }
-
-        public String getInputSourceEncoding() {
-            return null;
-        }
-
-        public boolean isAttributeSelected() {
-            return true;
-        }
-
-        public boolean isCreateDiagramsSelected() {
-            return false;
-        }
-
-        public boolean isDatatypeSelected() {
-            return true;
-        }
-
-        public boolean isMinimizeFigsSelected() {
-            return false;
-        }
-        
-    }
 }

Modified: trunk/src/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportClass.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportClass.java?view=diff&rev=15041&p1=trunk/src/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportClass.java&p2=trunk/src/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportClass.java&r1=15040&r2=15041
==============================================================================
--- trunk/src/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportClass.java	(original)
+++ trunk/src/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportClass.java	2008-06-22 15:03:27-0700
@@ -83,7 +83,7 @@
         new InitProfileSubsystem().init();
 
         Modeller modeller =
-            new Modeller(parsedModel, new DummyImportSettings(),
+            new Modeller(parsedModel, false, false,
                 "TestClass.java");
         assertNotNull("Creation of Modeller instance failed.", modeller);
 

Modified: trunk/src/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportEnumeration.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportEnumeration.java?view=diff&rev=15041&p1=trunk/src/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportEnumeration.java&p2=trunk/src/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportEnumeration.java&r1=15040&r2=15041
==============================================================================
--- trunk/src/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportEnumeration.java	(original)
+++ trunk/src/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportEnumeration.java	2008-06-22 15:03:27-0700
@@ -82,7 +82,7 @@
         new InitProfileSubsystem().init();
 
         Modeller modeller = new Modeller(parsedModel,
-                new DummyImportSettings(), "TestClass.java");
+                false, false, "TestClass.java");
         assertNotNull("Creation of Modeller instance failed.", modeller);
 
         try {

Modified: trunk/src/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportInterface.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportInterface.java?view=diff&rev=15041&p1=trunk/src/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportInterface.java&p2=trunk/src/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportInterface.java&r1=15040&r2=15041
==============================================================================
--- trunk/src/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportInterface.java	(original)
+++ trunk/src/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportInterface.java	2008-06-22 15:03:27-0700
@@ -84,7 +84,7 @@
         new InitProfileSubsystem().init();
 
         Modeller modeller =
-                new Modeller(parsedModel, new DummyImportSettings(),
+                new Modeller(parsedModel, false, false,
                     "TestInterface.java");
         assertNotNull("Creation of Modeller instance failed.", modeller);
 

Modified: trunk/src/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportUnicode.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportUnicode.java?view=diff&rev=15041&p1=trunk/src/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportUnicode.java&p2=trunk/src/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportUnicode.java&r1=15040&r2=15041
==============================================================================
--- trunk/src/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportUnicode.java	(original)
+++ trunk/src/argouml-app/tests/org/argouml/uml/reveng/TestJavaImportUnicode.java	2008-06-22 15:03:27-0700
@@ -93,7 +93,7 @@
                 parsedModel);
 
         Modeller modeller =
-            new Modeller(parsedModel, new DummyImportSettings(),
+            new Modeller(parsedModel, false, false,
                 "TestClass.java");
         assertNotNull("Creation of Modeller instance failed.", modeller);
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.