Author: thn
Date: 2008-07-22 13:06:22-0700
New Revision: 15345
Modified:
trunk/src/argouml-app/src/org/argouml/profile/URLModelLoader.java
trunk/src/argouml-app/src/org/argouml/ui/ProfileSelectionTab.java
trunk/src/argouml-app/src/org/argouml/ui/ProjectSettingsTabProfile.java
trunk/src/argouml-app/src/org/argouml/ui/SettingsTabProfile.java
Log:
fix for issue 5101: All ArgoUML supported XMI file extensions should be allowed
Modified: trunk/src/argouml-app/src/org/argouml/profile/URLModelLoader.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/profile/URLModelLoader.java?view=diff&rev=15345&p1=trunk/src/argouml-app/src/org/argouml/profile/URLModelLoader.java&p2=trunk/src/argouml-app/src/org/argouml/profile/URLModelLoader.java&r1=15344&r2=15345
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/profile/URLModelLoader.java (original)
+++ trunk/src/argouml-app/src/org/argouml/profile/URLModelLoader.java 2008-07-22 13:06:22-0700
@@ -24,8 +24,12 @@
package org.argouml.profile;
+import java.io.IOException;
+import java.net.MalformedURLException;
import java.net.URL;
import java.util.Collection;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
import org.argouml.model.Model;
import org.argouml.model.UmlException;
@@ -35,7 +39,7 @@
/**
* Abstract ProfileModelLoader which loads models from a URL.
*
- * @author Tom Morris
+ * @author Tom Morris, Thomas Neustupny
*/
public class URLModelLoader implements ProfileModelLoader {
@@ -53,14 +57,28 @@
if (url == null) {
throw new ProfileException("Null profile URL");
}
+ ZipInputStream zis = null;
try {
+ Collection elements = null;
XmiReader xmiReader = Model.getXmiReader();
+ if (url.getPath().toLowerCase().endsWith(".zip")) {
+ zis = new ZipInputStream(url.openStream());
+ ZipEntry entry = zis.getNextEntry();
+ // TODO: check if it's OK to just get the first zip entry
+ // since the zip file should contain only one xmi file - thn
+ if (entry != null) {
+ url = makeZipEntryUrl(url, entry.getName());
+ }
+ zis.close();
+ }
InputSource inputSource = new InputSource(url.toExternalForm());
inputSource.setPublicId(publicId.toString());
- Collection elements = xmiReader.parse(inputSource, true);
+ elements = xmiReader.parse(inputSource, true);
return elements;
} catch (UmlException e) {
throw new ProfileException("Invalid XMI data!", e);
+ } catch (IOException e) {
+ throw new ProfileException("Invalid zip file with XMI data!", e);
}
}
@@ -77,4 +95,10 @@
return loadModel(reference.getPublicReference(), reference
.getPublicReference());
}
+
+ private URL makeZipEntryUrl(URL url, String entryName)
+ throws MalformedURLException {
+ String entryURL = "jar:" + url + "!/" + entryName;
+ return new URL(entryURL);
+ }
}
Modified: trunk/src/argouml-app/src/org/argouml/ui/ProfileSelectionTab.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/ui/ProfileSelectionTab.java?view=diff&rev=15345&p1=trunk/src/argouml-app/src/org/argouml/ui/ProfileSelectionTab.java&p2=trunk/src/argouml-app/src/org/argouml/ui/ProfileSelectionTab.java&r1=15344&r2=15345
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/ui/ProfileSelectionTab.java (original)
+++ trunk/src/argouml-app/src/org/argouml/ui/ProfileSelectionTab.java 2008-07-22 13:06:22-0700
@@ -56,19 +56,19 @@
import org.argouml.profile.UserDefinedProfile;
/**
- * The Tab where new profiles can be added and the registered
- * ones can be activated or deactivated on current project
- *
+ * The Tab where new profiles can be added and the registered ones can be
+ * activated or deactivated on current project
+ *
* @author Marcos Aurélio
*/
public class ProfileSelectionTab extends JPanel implements
- GUISettingsTabInterface, ActionListener {
+ GUISettingsTabInterface, ActionListener {
private JButton loadFromFile = new JButton(Translator
- .localize("tab.profiles.userdefined.load"));
+ .localize("tab.profiles.userdefined.load"));
private JButton unregisterProfile = new JButton(Translator
- .localize("tab.profiles.userdefined.unload"));
+ .localize("tab.profiles.userdefined.unload"));
private JButton addButton = new JButton(">>");
@@ -79,97 +79,94 @@
private JList usedList = new JList(new UsedProfilesListModel());
/**
- * This List contains the registered profiles that have not been applied
- * to the current project
+ * This List contains the registered profiles that have not been applied to
+ * the current project
*
* @author maurelio1234
*/
private class AvailableProfilesListModel implements ListModel {
- private ProfileManager profileManager = ProfileFacade.getManager();
+ private ProfileManager profileManager = ProfileFacade.getManager();
- private List<ListDataListener> listeners =
- new ArrayList<ListDataListener>();
+ private List<ListDataListener> listeners = new ArrayList<ListDataListener>();
- /**
+ /**
* @param arg0
* @see javax.swing.ListModel#addListDataListener(javax.swing.event.ListDataListener)
*/
- public void addListDataListener(ListDataListener arg0) {
- listeners.add(arg0);
- }
-
- /**
- * Fire listeners
- */
- public void fireListeners() {
- ListDataEvent evt = new ListDataEvent(this,
- ListDataEvent.CONTENTS_CHANGED, 0, getSize());
- for (int i = 0; i < listeners.size(); ++i) {
- listeners.get(i).contentsChanged(evt);
- }
- }
-
- /**
- * @param n the profile to be returned
- * @return the n-th profile at the registered profiles list
- */
- public Profile getProfileAt(int n) {
- ProfileConfiguration config = ProjectManager.getManager()
- .getCurrentProject().getProfileConfiguration();
- List registeredProfiles = profileManager.getRegisteredProfiles();
- int count = 0;
- for (int i = 0; i < registeredProfiles.size(); ++i) {
- if (!config.getProfiles().contains(
- registeredProfiles.get(i))) {
-
- if (count == n) {
- return ((Profile) registeredProfiles.get(i));
- }
- ++count;
- }
- }
- return null;
- }
-
- /**
- * @param arg0
- * @return the arg0-th element of this list
- * @see javax.swing.ListModel#getElementAt(int)
- */
- public Object getElementAt(int arg0) {
- Profile p = getProfileAt(arg0);
- if (p != null) {
- return p.getDisplayName();
- } else {
- return null;
- }
- }
-
- /**
- * @return the amount of registered profiles not applied to current
- * project
- * @see javax.swing.ListModel#getSize()
- */
- public int getSize() {
- ProfileConfiguration config = ProjectManager.getManager()
- .getCurrentProject().getProfileConfiguration();
- List registeredProfiles = profileManager.getRegisteredProfiles();
- int count = 0;
- for (int i = 0; i < registeredProfiles.size(); ++i) {
- if (!config.getProfiles().contains(
- registeredProfiles.get(i))) {
- ++count;
- }
- }
- return count;
- }
+ public void addListDataListener(ListDataListener arg0) {
+ listeners.add(arg0);
+ }
- /*
+ /**
+ * Fire listeners
+ */
+ public void fireListeners() {
+ ListDataEvent evt = new ListDataEvent(this,
+ ListDataEvent.CONTENTS_CHANGED, 0, getSize());
+ for (int i = 0; i < listeners.size(); ++i) {
+ listeners.get(i).contentsChanged(evt);
+ }
+ }
+
+ /**
+ * @param n the profile to be returned
+ * @return the n-th profile at the registered profiles list
+ */
+ public Profile getProfileAt(int n) {
+ ProfileConfiguration config = ProjectManager.getManager()
+ .getCurrentProject().getProfileConfiguration();
+ List registeredProfiles = profileManager.getRegisteredProfiles();
+ int count = 0;
+ for (int i = 0; i < registeredProfiles.size(); ++i) {
+ if (!config.getProfiles().contains(registeredProfiles.get(i))) {
+
+ if (count == n) {
+ return ((Profile) registeredProfiles.get(i));
+ }
+ ++count;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * @param arg0
+ * @return the arg0-th element of this list
+ * @see javax.swing.ListModel#getElementAt(int)
+ */
+ public Object getElementAt(int arg0) {
+ Profile p = getProfileAt(arg0);
+ if (p != null) {
+ return p.getDisplayName();
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * @return the amount of registered profiles not applied to current
+ * project
+ * @see javax.swing.ListModel#getSize()
+ */
+ public int getSize() {
+ ProfileConfiguration config = ProjectManager.getManager()
+ .getCurrentProject().getProfileConfiguration();
+ List registeredProfiles = profileManager.getRegisteredProfiles();
+ int count = 0;
+ for (int i = 0; i < registeredProfiles.size(); ++i) {
+ if (!config.getProfiles().contains(registeredProfiles.get(i))) {
+ ++count;
+ }
+ }
+ return count;
+ }
+
+ /*
* @see javax.swing.ListModel#removeListDataListener(javax.swing.event.ListDataListener)
*/
- public void removeListDataListener(ListDataListener arg0) {
- listeners.remove(arg0);
- }
+ public void removeListDataListener(ListDataListener arg0) {
+ listeners.remove(arg0);
+ }
}
/**
@@ -178,43 +175,42 @@
* @author maurelio1234
*/
private class UsedProfilesListModel implements ListModel {
- private List<ListDataListener> listeners =
- new ArrayList<ListDataListener>();
+ private List<ListDataListener> listeners = new ArrayList<ListDataListener>();
- /*
+ /*
* @see javax.swing.ListModel#addListDataListener(javax.swing.event.ListDataListener)
*/
- public void addListDataListener(ListDataListener arg0) {
- listeners.add(arg0);
- }
-
- /**
- * Fires listeners
- */
- public void fireListeners() {
- ListDataEvent evt = new ListDataEvent(this,
- ListDataEvent.CONTENTS_CHANGED, 0, getSize());
- for (int i = 0; i < listeners.size(); ++i) {
- listeners.get(i).contentsChanged(evt);
- }
- }
-
- /**
- * @param n
- * @return the n-th profile on this list
- */
- public Profile getProfileAt(int n) {
- ProfileConfiguration config = ProjectManager.getManager()
- .getCurrentProject().getProfileConfiguration();
- return config.getProfiles().get(n);
- }
-
- /**
- * @param n
- * @return the n-th profile on this list
- * @see javax.swing.ListModel#getElementAt(int)
- */
- public Object getElementAt(int n) {
+ public void addListDataListener(ListDataListener arg0) {
+ listeners.add(arg0);
+ }
+
+ /**
+ * Fires listeners
+ */
+ public void fireListeners() {
+ ListDataEvent evt = new ListDataEvent(this,
+ ListDataEvent.CONTENTS_CHANGED, 0, getSize());
+ for (int i = 0; i < listeners.size(); ++i) {
+ listeners.get(i).contentsChanged(evt);
+ }
+ }
+
+ /**
+ * @param n
+ * @return the n-th profile on this list
+ */
+ public Profile getProfileAt(int n) {
+ ProfileConfiguration config = ProjectManager.getManager()
+ .getCurrentProject().getProfileConfiguration();
+ return config.getProfiles().get(n);
+ }
+
+ /**
+ * @param n
+ * @return the n-th profile on this list
+ * @see javax.swing.ListModel#getElementAt(int)
+ */
+ public Object getElementAt(int n) {
ProfileConfiguration config = ProjectManager.getManager()
.getCurrentProject().getProfileConfiguration();
if (n >= 0 && n < config.getProfiles().size()) {
@@ -222,85 +218,85 @@
} else {
return null;
}
- }
+ }
- /**
- * @return the amount of elements in the list
- * @see javax.swing.ListModel#getSize()
- */
- public int getSize() {
- ProfileConfiguration config = ProjectManager.getManager()
- .getCurrentProject().getProfileConfiguration();
- return config.getProfiles().size();
- }
+ /**
+ * @return the amount of elements in the list
+ * @see javax.swing.ListModel#getSize()
+ */
+ public int getSize() {
+ ProfileConfiguration config = ProjectManager.getManager()
+ .getCurrentProject().getProfileConfiguration();
+ return config.getProfiles().size();
+ }
- /*
+ /*
* @see javax.swing.ListModel#removeListDataListener(javax.swing.event.ListDataListener)
*/
- public void removeListDataListener(ListDataListener arg0) {
- listeners.remove(arg0);
- }
+ public void removeListDataListener(ListDataListener arg0) {
+ listeners.remove(arg0);
+ }
}
/**
* The default constructor for this class
*/
public ProfileSelectionTab() {
- setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
+ setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
- JPanel configPanel = new JPanel();
- configPanel.setLayout(new BoxLayout(configPanel, BoxLayout.X_AXIS));
+ JPanel configPanel = new JPanel();
+ configPanel.setLayout(new BoxLayout(configPanel, BoxLayout.X_AXIS));
- availableList.setPrototypeCellValue("12345678901234567890");
- usedList.setPrototypeCellValue("12345678901234567890");
+ availableList.setPrototypeCellValue("12345678901234567890");
+ usedList.setPrototypeCellValue("12345678901234567890");
- availableList.setMinimumSize(new Dimension(50, 50));
- usedList.setMinimumSize(new Dimension(50, 50));
-
- JPanel leftList = new JPanel();
- leftList.setLayout(new BorderLayout());
- leftList.add(new JLabel(Translator
- .localize("tab.profiles.userdefined.unload")),
- BorderLayout.NORTH);
- leftList.add(availableList, BorderLayout.CENTER);
- configPanel.add(leftList);
-
- JPanel centerButtons = new JPanel();
- centerButtons.setLayout(new BoxLayout(centerButtons, BoxLayout.Y_AXIS));
- centerButtons.add(addButton);
- centerButtons.add(removeButton);
- configPanel.add(centerButtons);
-
- JPanel rightList = new JPanel();
- rightList.setLayout(new BorderLayout());
- rightList.add(new JLabel(Translator
- .localize("tab.profiles.userdefined.active")),
- BorderLayout.NORTH);
- rightList.add(usedList, BorderLayout.CENTER);
- configPanel.add(rightList);
-
- addButton.addActionListener(this);
- removeButton.addActionListener(this);
-
- add(configPanel);
-
- JPanel lffPanel = new JPanel();
- lffPanel.setLayout(new FlowLayout());
- lffPanel.add(loadFromFile);
- lffPanel.add(unregisterProfile);
+ availableList.setMinimumSize(new Dimension(50, 50));
+ usedList.setMinimumSize(new Dimension(50, 50));
+
+ JPanel leftList = new JPanel();
+ leftList.setLayout(new BorderLayout());
+ leftList.add(new JLabel(Translator
+ .localize("tab.profiles.userdefined.unload")),
+ BorderLayout.NORTH);
+ leftList.add(availableList, BorderLayout.CENTER);
+ configPanel.add(leftList);
+
+ JPanel centerButtons = new JPanel();
+ centerButtons.setLayout(new BoxLayout(centerButtons, BoxLayout.Y_AXIS));
+ centerButtons.add(addButton);
+ centerButtons.add(removeButton);
+ configPanel.add(centerButtons);
+
+ JPanel rightList = new JPanel();
+ rightList.setLayout(new BorderLayout());
+ rightList.add(new JLabel(Translator
+ .localize("tab.profiles.userdefined.active")),
+ BorderLayout.NORTH);
+ rightList.add(usedList, BorderLayout.CENTER);
+ configPanel.add(rightList);
+
+ addButton.addActionListener(this);
+ removeButton.addActionListener(this);
+
+ add(configPanel);
+
+ JPanel lffPanel = new JPanel();
+ lffPanel.setLayout(new FlowLayout());
+ lffPanel.add(loadFromFile);
+ lffPanel.add(unregisterProfile);
- loadFromFile.addActionListener(this);
- unregisterProfile.addActionListener(this);
+ loadFromFile.addActionListener(this);
+ unregisterProfile.addActionListener(this);
- add(lffPanel);
+ add(lffPanel);
}
/*
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
public void actionPerformed(ActionEvent arg0) {
- AvailableProfilesListModel modelAvl =
- ((AvailableProfilesListModel) availableList.getModel());
+ AvailableProfilesListModel modelAvl = ((AvailableProfilesListModel) availableList
+ .getModel());
UsedProfilesListModel modelUsd = ((UsedProfilesListModel) usedList
.getModel());
@@ -310,22 +306,22 @@
.getSelectedIndex());
ProjectManager.getManager().getCurrentProject()
.getProfileConfiguration().addProfile(selected);
-
+
modelAvl.fireListeners();
modelUsd.fireListeners();
}
- } else if (arg0.getSource() == removeButton) {
+ } else if (arg0.getSource() == removeButton) {
if (usedList.getSelectedIndex() != -1) {
Profile selected = modelUsd.getProfileAt(usedList
.getSelectedIndex());
ProjectManager.getManager().getCurrentProject()
.getProfileConfiguration().removeProfile(selected);
-
+
modelAvl.fireListeners();
modelUsd.fireListeners();
}
- } else if (arg0.getSource() == unregisterProfile) {
- if (availableList.getSelectedIndex() != -1) {
+ } else if (arg0.getSource() == unregisterProfile) {
+ if (availableList.getSelectedIndex() != -1) {
Profile selected = modelAvl.getProfileAt(availableList
.getSelectedIndex());
if (selected instanceof UserDefinedProfile) {
@@ -345,19 +341,22 @@
public boolean accept(File file) {
return file.isDirectory()
|| (file.isFile() && (file.getName().toLowerCase()
- .endsWith(".xml")
- || file.getName()
- .toLowerCase().endsWith(".xmi")));
+ .endsWith(".xmi")
+ || file.getName().toLowerCase().endsWith(
+ ".xml")
+ || file.getName().toLowerCase().endsWith(
+ ".xmi.zip") || file.getName()
+ .toLowerCase().endsWith(".xml.zip")));
}
public String getDescription() {
- return "*.XMI";
+ return "*.xmi *.xml *.xmi.zip *.xml.zip";
}
});
- int ret = fileChooser.showOpenDialog(this);
- if (ret == JFileChooser.APPROVE_OPTION) {
+ int ret = fileChooser.showOpenDialog(this);
+ if (ret == JFileChooser.APPROVE_OPTION) {
File file = fileChooser.getSelectedFile();
try {
@@ -367,19 +366,19 @@
ProjectManager.getManager().getCurrentProject()
.getProfileConfiguration().addProfile(profile);
- UsedProfilesListModel model =
- (UsedProfilesListModel) usedList.getModel();
-
+ UsedProfilesListModel model = (UsedProfilesListModel) usedList
+ .getModel();
+
model.fireListeners();
} catch (ProfileException e) {
JOptionPane.showMessageDialog(this, Translator
.localize("tab.profiles.userdefined.errorloading"));
}
}
- }
+ }
- availableList.validate();
- usedList.validate();
+ availableList.validate();
+ usedList.validate();
}
/**
@@ -387,7 +386,7 @@
* @see org.argouml.application.api.GUISettingsTabInterface#getTabKey()
*/
public String getTabKey() {
- return "tab.profiles";
+ return "tab.profiles";
}
/**
@@ -395,26 +394,26 @@
* @see org.argouml.application.api.GUISettingsTabInterface#getTabPanel()
*/
public JPanel getTabPanel() {
- return this;
+ return this;
}
public void handleResetToDefault() {
- // TODO: Auto-generated method stub
+ // TODO: Auto-generated method stub
}
public void handleSettingsTabCancel() {
- // TODO: Auto-generated method stub
+ // TODO: Auto-generated method stub
}
public void handleSettingsTabRefresh() {
- // TODO: Auto-generated method stub
+ // TODO: Auto-generated method stub
}
public void handleSettingsTabSave() {
- // TODO: Auto-generated method stub
+ // TODO: Auto-generated method stub
}
Modified: trunk/src/argouml-app/src/org/argouml/ui/ProjectSettingsTabProfile.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/ui/ProjectSettingsTabProfile.java?view=diff&rev=15345&p1=trunk/src/argouml-app/src/org/argouml/ui/ProjectSettingsTabProfile.java&p2=trunk/src/argouml-app/src/org/argouml/ui/ProjectSettingsTabProfile.java&r1=15344&r2=15345
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/ui/ProjectSettingsTabProfile.java (original)
+++ trunk/src/argouml-app/src/org/argouml/ui/ProjectSettingsTabProfile.java 2008-07-22 13:06:22-0700
@@ -60,19 +60,19 @@
import org.argouml.uml.diagram.DiagramAppearance;
/**
- * The Tab where new profiles can be added and the registered
- * ones can be activated or deactivated on current project
- *
+ * The Tab where new profiles can be added and the registered ones can be
+ * activated or deactivated on current project
+ *
* @author Marcos Aurélio
*/
public class ProjectSettingsTabProfile extends JPanel implements
- GUISettingsTabInterface, ActionListener {
+ GUISettingsTabInterface, ActionListener {
private JButton loadFromFile = new JButton(Translator
- .localize("tab.profiles.userdefined.load"));
+ .localize("tab.profiles.userdefined.load"));
private JButton unregisterProfile = new JButton(Translator
- .localize("tab.profiles.userdefined.unload"));
+ .localize("tab.profiles.userdefined.unload"));
private JButton addButton = new JButton(">>");
@@ -81,11 +81,12 @@
private JList availableList = new JList();
private JList usedList = new JList();
-
- ////////
-
- private JLabel stereoLabel =
- new JLabel(Translator.localize("menu.popup.stereotype-view") + ": ");
+
+ // //////
+
+ private JLabel stereoLabel = new JLabel(Translator
+ .localize("menu.popup.stereotype-view")
+ + ": ");
private JComboBox stereoField = new JComboBox();
@@ -93,20 +94,20 @@
* The default constructor for this class
*/
public ProjectSettingsTabProfile() {
- setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
+ setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
+
+ // ////////////
- //////////////
-
JPanel setDefStereoV = new JPanel();
- setDefStereoV.setLayout(new FlowLayout());
-
+ setDefStereoV.setLayout(new FlowLayout());
+
stereoLabel.setLabelFor(stereoField);
setDefStereoV.add(stereoLabel);
setDefStereoV.add(stereoField);
DefaultComboBoxModel cmodel = new DefaultComboBoxModel();
stereoField.setModel(cmodel);
-
+
cmodel.addElement(Translator
.localize("menu.popup.stereotype-view.textual"));
cmodel.addElement(Translator
@@ -120,89 +121,88 @@
ProjectSettings ps = ProjectManager.getManager()
.getCurrentProject().getProjectSettings();
Object src = e.getSource();
-
+
if (src == stereoField) {
Object item = e.getItem();
- DefaultComboBoxModel model =
- (DefaultComboBoxModel) stereoField.getModel();
+ DefaultComboBoxModel model = (DefaultComboBoxModel) stereoField
+ .getModel();
int idx = model.getIndexOf(item);
switch (idx) {
case 0:
- ps.setDefaultStereotypeView(
- DiagramAppearance.STEREOTYPE_VIEW_TEXTUAL);
+ ps
+ .setDefaultStereotypeView(DiagramAppearance.STEREOTYPE_VIEW_TEXTUAL);
break;
case 1:
- ps.setDefaultStereotypeView(
- DiagramAppearance.STEREOTYPE_VIEW_BIG_ICON);
+ ps
+ .setDefaultStereotypeView(DiagramAppearance.STEREOTYPE_VIEW_BIG_ICON);
break;
case 2:
- ps.setDefaultStereotypeView(
- DiagramAppearance.STEREOTYPE_VIEW_SMALL_ICON);
+ ps
+ .setDefaultStereotypeView(DiagramAppearance.STEREOTYPE_VIEW_SMALL_ICON);
break;
}
}
}
-
+
});
add(setDefStereoV);
-
- ////////////
-
-
- JPanel configPanel = new JPanel();
- configPanel.setLayout(new BoxLayout(configPanel, BoxLayout.X_AXIS));
-
- availableList.setPrototypeCellValue("12345678901234567890");
- usedList.setPrototypeCellValue("12345678901234567890");
-
- availableList.setMinimumSize(new Dimension(50, 50));
- usedList.setMinimumSize(new Dimension(50, 50));
-
- JPanel leftList = new JPanel();
- leftList.setLayout(new BorderLayout());
- leftList.add(new JLabel(Translator
- .localize("tab.profiles.userdefined.available")),
- BorderLayout.NORTH);
- leftList.add(new JScrollPane(availableList), BorderLayout.CENTER);
- configPanel.add(leftList);
-
- JPanel centerButtons = new JPanel();
- centerButtons.setLayout(new BoxLayout(centerButtons, BoxLayout.Y_AXIS));
- centerButtons.add(addButton);
- centerButtons.add(removeButton);
- configPanel.add(centerButtons);
-
- JPanel rightList = new JPanel();
- rightList.setLayout(new BorderLayout());
- rightList.add(new JLabel(Translator
- .localize("tab.profiles.userdefined.active")),
- BorderLayout.NORTH);
- rightList.add(new JScrollPane(usedList), BorderLayout.CENTER);
- configPanel.add(rightList);
-
- addButton.addActionListener(this);
- removeButton.addActionListener(this);
-
- add(configPanel);
-
- JPanel lffPanel = new JPanel();
- lffPanel.setLayout(new FlowLayout());
- lffPanel.add(loadFromFile);
- lffPanel.add(unregisterProfile);
- loadFromFile.addActionListener(this);
- unregisterProfile.addActionListener(this);
+ // //////////
+
+ JPanel configPanel = new JPanel();
+ configPanel.setLayout(new BoxLayout(configPanel, BoxLayout.X_AXIS));
+
+ availableList.setPrototypeCellValue("12345678901234567890");
+ usedList.setPrototypeCellValue("12345678901234567890");
- add(lffPanel);
+ availableList.setMinimumSize(new Dimension(50, 50));
+ usedList.setMinimumSize(new Dimension(50, 50));
+
+ JPanel leftList = new JPanel();
+ leftList.setLayout(new BorderLayout());
+ leftList.add(new JLabel(Translator
+ .localize("tab.profiles.userdefined.available")),
+ BorderLayout.NORTH);
+ leftList.add(new JScrollPane(availableList), BorderLayout.CENTER);
+ configPanel.add(leftList);
+
+ JPanel centerButtons = new JPanel();
+ centerButtons.setLayout(new BoxLayout(centerButtons, BoxLayout.Y_AXIS));
+ centerButtons.add(addButton);
+ centerButtons.add(removeButton);
+ configPanel.add(centerButtons);
+
+ JPanel rightList = new JPanel();
+ rightList.setLayout(new BorderLayout());
+ rightList.add(new JLabel(Translator
+ .localize("tab.profiles.userdefined.active")),
+ BorderLayout.NORTH);
+ rightList.add(new JScrollPane(usedList), BorderLayout.CENTER);
+ configPanel.add(rightList);
+
+ addButton.addActionListener(this);
+ removeButton.addActionListener(this);
+
+ add(configPanel);
+
+ JPanel lffPanel = new JPanel();
+ lffPanel.setLayout(new FlowLayout());
+ lffPanel.add(loadFromFile);
+ lffPanel.add(unregisterProfile);
+
+ loadFromFile.addActionListener(this);
+ unregisterProfile.addActionListener(this);
+
+ add(lffPanel);
}
private void refreshLists() {
- availableList.setModel(
- new DefaultComboBoxModel(getAvailableProfiles().toArray()));
- usedList.setModel(
- new DefaultComboBoxModel(getUsedProfiles().toArray()));
+ availableList.setModel(new DefaultComboBoxModel(getAvailableProfiles()
+ .toArray()));
+ usedList
+ .setModel(new DefaultComboBoxModel(getUsedProfiles().toArray()));
}
private List<Profile> getUsedProfiles() {
@@ -213,14 +213,14 @@
private List<Profile> getAvailableProfiles() {
List<Profile> used = getUsedProfiles();
List<Profile> ret = new ArrayList<Profile>();
-
+
for (Profile profile : ProfileFacade.getManager()
.getRegisteredProfiles()) {
if (!used.contains(profile)) {
ret.add(profile);
}
}
-
+
return ret;
}
@@ -228,10 +228,10 @@
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
public void actionPerformed(ActionEvent arg0) {
- MutableComboBoxModel modelAvailable =
- ((MutableComboBoxModel) availableList.getModel());
- MutableComboBoxModel modelUsed =
- ((MutableComboBoxModel) usedList.getModel());
+ MutableComboBoxModel modelAvailable = ((MutableComboBoxModel) availableList
+ .getModel());
+ MutableComboBoxModel modelUsed = ((MutableComboBoxModel) usedList
+ .getModel());
if (arg0.getSource() == addButton) {
if (availableList.getSelectedIndex() != -1) {
@@ -239,39 +239,35 @@
.getElementAt(availableList.getSelectedIndex());
modelUsed.addElement(selected);
modelAvailable.removeElement(selected);
-
+
for (Profile profile : getAvailableDependents(selected)) {
modelUsed.addElement(profile);
- modelAvailable.removeElement(profile);
+ modelAvailable.removeElement(profile);
}
}
- } else if (arg0.getSource() == removeButton) {
+ } else if (arg0.getSource() == removeButton) {
if (usedList.getSelectedIndex() != -1) {
Profile selected = (Profile) modelUsed.getElementAt(usedList
.getSelectedIndex());
-
- List<Profile> dependents = getActiveDependents(selected);
+
+ List<Profile> dependents = getActiveDependents(selected);
boolean remove = true;
if (!dependents.isEmpty()) {
String message = Translator.localize(
"tab.profiles.confirmdeletewithdependencies",
- new Object[] {dependents});
- String title = Translator.localize(
- "tab.profiles.confirmdeletewithdependencies.title");
- remove = (JOptionPane
- .showConfirmDialog(
- this,
- message,
- title,
- JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION);
+ new Object[] { dependents });
+ String title = Translator
+ .localize("tab.profiles.confirmdeletewithdependencies.title");
+ remove = (JOptionPane.showConfirmDialog(this, message,
+ title, JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION);
}
-
+
if (remove) {
- if (!ProfileFacade.getManager()
- .getRegisteredProfiles().contains(selected)
- && !ProfileFacade.getManager()
- .getDefaultProfiles().contains(selected)) {
+ if (!ProfileFacade.getManager().getRegisteredProfiles()
+ .contains(selected)
+ && !ProfileFacade.getManager().getDefaultProfiles()
+ .contains(selected)) {
remove = (JOptionPane
.showConfirmDialog(
this,
@@ -285,7 +281,7 @@
if (remove) {
modelUsed.removeElement(selected);
modelAvailable.addElement(selected);
-
+
for (Profile profile : dependents) {
modelUsed.removeElement(profile);
modelAvailable.addElement(profile);
@@ -293,8 +289,8 @@
}
}
}
- } else if (arg0.getSource() == unregisterProfile) {
- if (availableList.getSelectedIndex() != -1) {
+ } else if (arg0.getSource() == unregisterProfile) {
+ if (availableList.getSelectedIndex() != -1) {
Profile selected = (Profile) modelAvailable
.getElementAt(availableList.getSelectedIndex());
if (selected instanceof UserDefinedProfile) {
@@ -305,25 +301,28 @@
.localize("tab.profiles.cannotdelete"));
}
}
- } else if (arg0.getSource() == loadFromFile) {
- JFileChooser fileChooser = new JFileChooser();
- fileChooser.setFileFilter(new FileFilter() {
-
- public boolean accept(File file) {
- return file.isDirectory()
- || (file.isFile()
- && (file.getName().endsWith(".xml")
- || file.getName().endsWith(".xmi")));
- }
-
- public String getDescription() {
- return "XMI Files";
- }
+ } else if (arg0.getSource() == loadFromFile) {
+ JFileChooser fileChooser = new JFileChooser();
+ fileChooser.setFileFilter(new FileFilter() {
+
+ public boolean accept(File file) {
+ return file.isDirectory()
+ || (file.isFile() && (file.getName().endsWith(
+ ".xmi")
+ || file.getName().endsWith(".xml")
+ || file.getName().toLowerCase().endsWith(
+ ".xmi.zip") || file.getName()
+ .toLowerCase().endsWith(".xml.zip")));
+ }
+
+ public String getDescription() {
+ return "*.xmi *.xml *.xmi.zip *.xml.zip";
+ }
- });
+ });
- int ret = fileChooser.showOpenDialog(this);
- if (ret == JFileChooser.APPROVE_OPTION) {
+ int ret = fileChooser.showOpenDialog(this);
+ if (ret == JFileChooser.APPROVE_OPTION) {
File file = fileChooser.getSelectedFile();
try {
@@ -338,39 +337,39 @@
}
}
- availableList.validate();
- usedList.validate();
+ availableList.validate();
+ usedList.validate();
}
private List<Profile> getAvailableDependents(Profile selected) {
MutableComboBoxModel modelAvl = ((MutableComboBoxModel) availableList
.getModel());
-
+
List<Profile> ret = new ArrayList<Profile>();
for (int i = 0; i < modelAvl.getSize(); ++i) {
Profile p = (Profile) modelAvl.getElementAt(i);
-
+
if (!p.equals(selected) && selected.getDependencies().contains(p)) {
ret.add(p);
}
}
-
+
return ret;
}
private List<Profile> getActiveDependents(Profile selected) {
MutableComboBoxModel modelUsd = ((MutableComboBoxModel) usedList
.getModel());
-
+
List<Profile> ret = new ArrayList<Profile>();
for (int i = 0; i < modelUsd.getSize(); ++i) {
Profile p = (Profile) modelUsd.getElementAt(i);
-
+
if (!p.equals(selected) && p.getDependencies().contains(selected)) {
ret.add(p);
}
}
-
+
return ret;
}
@@ -379,7 +378,7 @@
* @see org.argouml.application.api.GUISettingsTabInterface#getTabKey()
*/
public String getTabKey() {
- return "tab.profiles";
+ return "tab.profiles";
}
/**
@@ -387,7 +386,7 @@
* @see org.argouml.application.api.GUISettingsTabInterface#getTabPanel()
*/
public JPanel getTabPanel() {
- return this;
+ return this;
}
public void handleResetToDefault() {
@@ -401,19 +400,19 @@
public void handleSettingsTabRefresh() {
ProjectSettings ps = ProjectManager.getManager().getCurrentProject()
.getProjectSettings();
-
+
switch (ps.getDefaultStereotypeViewValue()) {
case DiagramAppearance.STEREOTYPE_VIEW_TEXTUAL:
- stereoField.setSelectedIndex(0);
+ stereoField.setSelectedIndex(0);
break;
case DiagramAppearance.STEREOTYPE_VIEW_BIG_ICON:
- stereoField.setSelectedIndex(1);
+ stereoField.setSelectedIndex(1);
break;
case DiagramAppearance.STEREOTYPE_VIEW_SMALL_ICON:
- stereoField.setSelectedIndex(2);
+ stereoField.setSelectedIndex(2);
break;
}
-
+
refreshLists();
}
@@ -421,16 +420,16 @@
List<Profile> toRemove = new ArrayList<Profile>();
ProfileConfiguration pc = ProjectManager.getManager()
.getCurrentProject().getProfileConfiguration();
-
+
List<Profile> usedItens = new ArrayList<Profile>();
MutableComboBoxModel modelUsd = ((MutableComboBoxModel) usedList
.getModel());
-
+
for (int i = 0; i < modelUsd.getSize(); ++i) {
usedItens.add((Profile) modelUsd.getElementAt(i));
}
-
+
for (Profile profile : pc.getProfiles()) {
if (!usedItens.contains(profile)) {
toRemove.add(profile);
@@ -438,15 +437,15 @@
}
for (Profile profile : toRemove) {
- pc.removeProfile(profile);
+ pc.removeProfile(profile);
}
-
+
for (Profile profile : usedItens) {
if (!pc.getProfiles().contains(profile)) {
pc.addProfile(profile);
}
}
-
+
}
}
Modified: trunk/src/argouml-app/src/org/argouml/ui/SettingsTabProfile.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/ui/SettingsTabProfile.java?view=diff&rev=15345&p1=trunk/src/argouml-app/src/org/argouml/ui/SettingsTabProfile.java&p2=trunk/src/argouml-app/src/org/argouml/ui/SettingsTabProfile.java&r1=15344&r2=15345
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/ui/SettingsTabProfile.java (original)
+++ trunk/src/argouml-app/src/org/argouml/ui/SettingsTabProfile.java 2008-07-22 13:06:22-0700
@@ -62,17 +62,17 @@
/**
* The Tab containing the global settings for profiles
- *
+ *
* @author Marcos Aurélio
*/
public class SettingsTabProfile extends JPanel implements
- GUISettingsTabInterface, ActionListener {
+ GUISettingsTabInterface, ActionListener {
private JButton loadFromFile = new JButton(Translator
- .localize("tab.profiles.userdefined.load"));
+ .localize("tab.profiles.userdefined.load"));
private JButton unregisterProfile = new JButton(Translator
- .localize("tab.profiles.userdefined.unload"));
+ .localize("tab.profiles.userdefined.unload"));
private JButton addButton = new JButton(">>");
@@ -82,8 +82,8 @@
private JList defaultList = new JList();
- ////////
-
+ // //////
+
private JList directoryList = new JList();
private JButton addDirectory = new JButton(Translator
@@ -93,21 +93,22 @@
.localize("tab.profiles.directories.remove"));
private JButton refreshProfiles = new JButton(Translator
- .localize("tab.profiles.directories.refresh"));
+ .localize("tab.profiles.directories.refresh"));
- ///////
+ // /////
- private JLabel stereoLabel =
- new JLabel(Translator.localize("menu.popup.stereotype-view") + ": ");
+ private JLabel stereoLabel = new JLabel(Translator
+ .localize("menu.popup.stereotype-view")
+ + ": ");
private JComboBox stereoField = new JComboBox();
-
+
/**
* The default constructor for this class.
*/
public SettingsTabProfile() {
setLayout(new BorderLayout());
-
+
JPanel warning = new JPanel();
warning.setLayout(new BoxLayout(warning, BoxLayout.PAGE_AXIS));
JLabel warningLabel = new JLabel(Translator.localize("label.warning"));
@@ -120,17 +121,17 @@
projectSettings.setIcon(null);
projectSettings.setAlignmentX(Component.RIGHT_ALIGNMENT);
warning.add(projectSettings);
-
+
add(warning, BorderLayout.NORTH);
-
+
JPanel profileSettings = new JPanel();
profileSettings.setLayout(new BoxLayout(profileSettings,
BoxLayout.Y_AXIS));
profileSettings.add(initDefaultStereotypeViewSelector());
- directoryList.setPrototypeCellValue(
- "123456789012345678901234567890123456789012345678901234567890");
+ directoryList
+ .setPrototypeCellValue("123456789012345678901234567890123456789012345678901234567890");
directoryList.setMinimumSize(new Dimension(50, 50));
JPanel sdirPanel = new JPanel();
@@ -236,25 +237,28 @@
if (src == stereoField) {
Object item = e.getItem();
- DefaultComboBoxModel model = (DefaultComboBoxModel)
- stereoField.getModel();
+ DefaultComboBoxModel model = (DefaultComboBoxModel) stereoField
+ .getModel();
int idx = model.getIndexOf(item);
switch (idx) {
case 0:
- Configuration.setInteger(
- ProfileConfiguration.KEY_DEFAULT_STEREOTYPE_VIEW,
- DiagramAppearance.STEREOTYPE_VIEW_TEXTUAL);
+ Configuration
+ .setInteger(
+ ProfileConfiguration.KEY_DEFAULT_STEREOTYPE_VIEW,
+ DiagramAppearance.STEREOTYPE_VIEW_TEXTUAL);
break;
case 1:
- Configuration.setInteger(
- ProfileConfiguration.KEY_DEFAULT_STEREOTYPE_VIEW,
- DiagramAppearance.STEREOTYPE_VIEW_BIG_ICON);
+ Configuration
+ .setInteger(
+ ProfileConfiguration.KEY_DEFAULT_STEREOTYPE_VIEW,
+ DiagramAppearance.STEREOTYPE_VIEW_BIG_ICON);
break;
case 2:
- Configuration.setInteger(
- ProfileConfiguration.KEY_DEFAULT_STEREOTYPE_VIEW,
- DiagramAppearance.STEREOTYPE_VIEW_SMALL_ICON);
+ Configuration
+ .setInteger(
+ ProfileConfiguration.KEY_DEFAULT_STEREOTYPE_VIEW,
+ DiagramAppearance.STEREOTYPE_VIEW_SMALL_ICON);
break;
}
}
@@ -281,17 +285,17 @@
private List<Profile> getAvailableProfiles() {
List<Profile> used = getUsedProfiles();
List<Profile> ret = new ArrayList<Profile>();
-
+
for (Profile profile : ProfileFacade.getManager()
.getRegisteredProfiles()) {
if (!used.contains(profile)) {
ret.add(profile);
}
}
-
+
return ret;
}
-
+
/*
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
@@ -303,22 +307,22 @@
if (arg0.getSource() == addButton) {
if (availableList.getSelectedIndex() != -1) {
- Profile selected = (Profile) modelAvl.getElementAt(availableList
- .getSelectedIndex());
+ Profile selected = (Profile) modelAvl
+ .getElementAt(availableList.getSelectedIndex());
modelUsd.addElement(selected);
modelAvl.removeElement(selected);
}
- } else if (arg0.getSource() == removeButton) {
+ } else if (arg0.getSource() == removeButton) {
if (defaultList.getSelectedIndex() != -1) {
Profile selected = (Profile) modelUsd.getElementAt(defaultList
.getSelectedIndex());
modelUsd.removeElement(selected);
- modelAvl.addElement(selected);
+ modelAvl.addElement(selected);
}
- } else if (arg0.getSource() == unregisterProfile) {
- if (availableList.getSelectedIndex() != -1) {
- Profile selected = (Profile) modelAvl.getElementAt(availableList
- .getSelectedIndex());
+ } else if (arg0.getSource() == unregisterProfile) {
+ if (availableList.getSelectedIndex() != -1) {
+ Profile selected = (Profile) modelAvl
+ .getElementAt(availableList.getSelectedIndex());
if (selected instanceof UserDefinedProfile) {
ProfileFacade.getManager().removeProfile(selected);
modelAvl.removeElement(selected);
@@ -327,26 +331,30 @@
.localize("tab.profiles.cannotdelete"));
}
}
- } else if (arg0.getSource() == loadFromFile) {
- JFileChooser fileChooser = new JFileChooser();
- fileChooser.setFileFilter(new FileFilter() {
+ } else if (arg0.getSource() == loadFromFile) {
+ JFileChooser fileChooser = new JFileChooser();
+ fileChooser.setFileFilter(new FileFilter() {
- public boolean accept(File file) {
+ public boolean accept(File file) {
return file.isDirectory()
|| (file.isFile() && (file.getName().toLowerCase()
- .endsWith(".xml") || file.getName()
- .toLowerCase().endsWith(".xmi")));
+ .endsWith(".xmi")
+ || file.getName().toLowerCase().endsWith(
+ ".xml")
+ || file.getName().toLowerCase().endsWith(
+ ".xmi.zip") || file.getName()
+ .toLowerCase().endsWith(".xml.zip")));
+ }
+
+ public String getDescription() {
+ return "*.xmi *.xml *.xmi.zip *.xml.zip";
}
- public String getDescription() {
- return "*.XMI";
- }
-
- });
-
- int ret = fileChooser.showOpenDialog(this);
- if (ret == JFileChooser.APPROVE_OPTION) {
- File file = fileChooser.getSelectedFile();
+ });
+
+ int ret = fileChooser.showOpenDialog(this);
+ if (ret == JFileChooser.APPROVE_OPTION) {
+ File file = fileChooser.getSelectedFile();
try {
UserDefinedProfile profile = new UserDefinedProfile(file);
@@ -360,22 +368,22 @@
}
}
- } else if (arg0.getSource() == removeDirectory) {
+ } else if (arg0.getSource() == removeDirectory) {
if (directoryList.getSelectedIndex() != -1) {
int idx = directoryList.getSelectedIndex();
((MutableComboBoxModel) directoryList.getModel())
.removeElementAt(idx);
}
- } else if (arg0.getSource() == refreshProfiles) {
- boolean refresh = JOptionPane.showConfirmDialog(this,
- Translator.localize("tab.profiles.confirmrefresh"),
- Translator.localize("tab.profiles.confirmrefresh.title"),
- JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION;
+ } else if (arg0.getSource() == refreshProfiles) {
+ boolean refresh = JOptionPane.showConfirmDialog(this, Translator
+ .localize("tab.profiles.confirmrefresh"), Translator
+ .localize("tab.profiles.confirmrefresh.title"),
+ JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION;
if (refresh) {
handleSettingsTabSave();
ProfileFacade.getManager().refreshRegisteredProfiles();
refreshLists();
- }
+ }
} else if (arg0.getSource() == addDirectory) {
JFileChooser fileChooser = new JFileChooser();
fileChooser.setFileFilter(new FileFilter() {
@@ -391,7 +399,7 @@
});
fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
-
+
int ret = fileChooser.showOpenDialog(this);
if (ret == JFileChooser.APPROVE_OPTION) {
File file = fileChooser.getSelectedFile();
@@ -401,11 +409,11 @@
((MutableComboBoxModel) directoryList.getModel())
.addElement(path);
}
-
+
}
-
- availableList.validate();
- defaultList.validate();
+
+ availableList.validate();
+ defaultList.validate();
}
/**
@@ -413,7 +421,7 @@
* @see org.argouml.application.api.GUISettingsTabInterface#getTabKey()
*/
public String getTabKey() {
- return "tab.profiles";
+ return "tab.profiles";
}
/**
@@ -421,7 +429,7 @@
* @see org.argouml.application.api.GUISettingsTabInterface#getTabPanel()
*/
public JPanel getTabPanel() {
- return this;
+ return this;
}
public void handleResetToDefault() {
@@ -434,37 +442,36 @@
public void handleSettingsTabRefresh() {
refreshLists();
-
+
switch (Configuration.getInteger(
ProfileConfiguration.KEY_DEFAULT_STEREOTYPE_VIEW,
DiagramAppearance.STEREOTYPE_VIEW_TEXTUAL)) {
case DiagramAppearance.STEREOTYPE_VIEW_TEXTUAL:
- stereoField.setSelectedIndex(0);
+ stereoField.setSelectedIndex(0);
break;
case DiagramAppearance.STEREOTYPE_VIEW_BIG_ICON:
- stereoField.setSelectedIndex(1);
+ stereoField.setSelectedIndex(1);
break;
case DiagramAppearance.STEREOTYPE_VIEW_SMALL_ICON:
- stereoField.setSelectedIndex(2);
+ stereoField.setSelectedIndex(2);
break;
- }
+ }
}
public void handleSettingsTabSave() {
- List<Profile> toRemove = new ArrayList<Profile>();
+ List<Profile> toRemove = new ArrayList<Profile>();
List<Profile> usedItens = new ArrayList<Profile>();
MutableComboBoxModel modelUsd = ((MutableComboBoxModel) defaultList
.getModel());
MutableComboBoxModel modelDir = ((MutableComboBoxModel) directoryList
.getModel());
-
+
for (int i = 0; i < modelUsd.getSize(); ++i) {
usedItens.add((Profile) modelUsd.getElementAt(i));
}
- for (Profile profile : ProfileFacade.getManager()
- .getDefaultProfiles()) {
+ for (Profile profile : ProfileFacade.getManager().getDefaultProfiles()) {
if (!usedItens.contains(profile)) {
toRemove.add(profile);
}
@@ -475,15 +482,15 @@
}
for (Profile profile : usedItens) {
- if (!ProfileFacade.getManager().getDefaultProfiles()
- .contains(profile)) {
+ if (!ProfileFacade.getManager().getDefaultProfiles().contains(
+ profile)) {
ProfileFacade.getManager().addToDefaultProfiles(profile);
}
}
-
- List<String> toRemoveDir = new ArrayList<String>();
+
+ List<String> toRemoveDir = new ArrayList<String>();
List<String> usedItensDir = new ArrayList<String>();
-
+
for (int i = 0; i < modelDir.getSize(); ++i) {
usedItensDir.add((String) modelDir.getElementAt(i));
}
@@ -496,15 +503,13 @@
}
for (String dirEntry : toRemoveDir) {
- ProfileFacade.getManager()
- .removeSearchPathDirectory(dirEntry);
+ ProfileFacade.getManager().removeSearchPathDirectory(dirEntry);
}
for (String dirEntry : usedItensDir) {
if (!ProfileFacade.getManager().getSearchPathDirectories()
.contains(dirEntry)) {
- ProfileFacade.getManager().addSearchPathDirectory(
- dirEntry);
+ ProfileFacade.getManager().addSearchPathDirectory(dirEntry);
}
}
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.