Author: tfmorris
Date: 2007-07-25 13:18:55-0700
New Revision: 13145
Added:
trunk/src_new/org/argouml/ui/explorer/rules/GoProjectToRoots.java (contents, props changed)
Modified:
trunk/src_new/org/argouml/i18n/misc.properties
trunk/src_new/org/argouml/ui/explorer/PerspectiveManager.java
Log:
Add rule to display multiple top level elements for a project
Modified: trunk/src_new/org/argouml/i18n/misc.properties
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/i18n/misc.properties?view=diff&rev=13145&p1=trunk/src_new/org/argouml/i18n/misc.properties&p2=trunk/src_new/org/argouml/i18n/misc.properties&r1=13144&r2=13145
==============================================================================
--- trunk/src_new/org/argouml/i18n/misc.properties (original)
+++ trunk/src_new/org/argouml/i18n/misc.properties 2007-07-25 13:18:55-0700
@@ -150,6 +150,7 @@
misc.project.collaboration = Project->Collaboration
misc.project.diagram = Project->Diagram
misc.project.model = Project->Model
+misc.project.roots = Project->Root Elements
misc.project.state-machine = Project->State Machine
misc.properties = Properties
misc.receives = Receives:
Modified: trunk/src_new/org/argouml/ui/explorer/PerspectiveManager.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/ui/explorer/PerspectiveManager.java?view=diff&rev=13145&p1=trunk/src_new/org/argouml/ui/explorer/PerspectiveManager.java&p2=trunk/src_new/org/argouml/ui/explorer/PerspectiveManager.java&r1=13144&r2=13145
==============================================================================
--- trunk/src_new/org/argouml/ui/explorer/PerspectiveManager.java (original)
+++ trunk/src_new/org/argouml/ui/explorer/PerspectiveManager.java 2007-07-25 13:18:55-0700
@@ -75,11 +75,12 @@
import org.argouml.ui.explorer.rules.GoOperationToCollaboration;
import org.argouml.ui.explorer.rules.GoOperationToCollaborationDiagram;
import org.argouml.ui.explorer.rules.GoOperationToSequenceDiagram;
-import org.argouml.ui.explorer.rules.GoPackageToElementImport;
import org.argouml.ui.explorer.rules.GoPackageToClass;
+import org.argouml.ui.explorer.rules.GoPackageToElementImport;
import org.argouml.ui.explorer.rules.GoProjectToCollaboration;
import org.argouml.ui.explorer.rules.GoProjectToDiagram;
import org.argouml.ui.explorer.rules.GoProjectToModel;
+import org.argouml.ui.explorer.rules.GoProjectToRoots;
import org.argouml.ui.explorer.rules.GoProjectToStateMachine;
import org.argouml.ui.explorer.rules.GoSignalToReception;
import org.argouml.ui.explorer.rules.GoStateMachineToState;
@@ -338,7 +339,7 @@
ExplorerPerspective classPerspective =
new ExplorerPerspective(
"combobox.item.class-centric");
- classPerspective.addRule(new GoProjectToModel());
+ classPerspective.addRule(new GoProjectToRoots());
classPerspective.addRule(new GoNamespaceToClassifierAndPackage());
classPerspective.addRule(new GoNamespaceToDiagram());
classPerspective.addRule(new GoClassToSummary());
@@ -352,7 +353,7 @@
ExplorerPerspective packagePerspective =
new ExplorerPerspective(
"combobox.item.package-centric");
- packagePerspective.addRule(new GoProjectToModel());
+ packagePerspective.addRule(new GoProjectToRoots());
packagePerspective.addRule(new GoNamespaceToOwnedElements());
packagePerspective.addRule(new GoPackageToElementImport());
packagePerspective.addRule(new GoNamespaceToDiagram());
@@ -454,7 +455,7 @@
ExplorerPerspective compositionPerspective =
new ExplorerPerspective(
"combobox.item.composite-centric");
- compositionPerspective.addRule(new GoProjectToModel());
+ compositionPerspective.addRule(new GoProjectToRoots());
compositionPerspective.addRule(new GoModelElementToContents());
compositionPerspective.addRule(new GoModelElementToContainedDiagrams());
@@ -515,6 +516,7 @@
new GoPackageToElementImport(),
new GoProjectToCollaboration(), new GoProjectToDiagram(),
new GoProjectToModel(), new GoProjectToStateMachine(),
+ new GoProjectToRoots(),
new GoSignalToReception(), new GoStateMachineToTop(),
new GoStatemachineToDiagram(), new GoStateMachineToState(),
new GoStateMachineToTransition(), new GoStateToDoActivity(),
Added: trunk/src_new/org/argouml/ui/explorer/rules/GoProjectToRoots.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/ui/explorer/rules/GoProjectToRoots.java?view=auto&rev=13145
==============================================================================
--- (empty file)
+++ trunk/src_new/org/argouml/ui/explorer/rules/GoProjectToRoots.java 2007-07-25 13:18:55-0700
@@ -0,0 +1,64 @@
+// $Id$
+// Copyright (c) 1996-2006 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.ui.explorer.rules;
+
+import java.util.Collection;
+import java.util.Set;
+
+import org.argouml.i18n.Translator;
+import org.argouml.kernel.Project;
+import org.argouml.model.Model;
+
+/**
+ * Rule for Project->Root (Top level) Elements.
+ *
+ * TODO: As currently implemented it returns all top level elements in
+ * the model repository, not just those in a given project. Since we
+ * only support a single project at a time currently, these are equivalent
+ * but this will need to be enhanced with additional bookkeeping in
+ * Project when we support multiple open projects - tfm.
+ *
+ * @author Tom Morris <[email protected]>
+ */
+public class GoProjectToRoots extends AbstractPerspectiveRule {
+
+
+ public String getRuleName() {
+ return Translator.localize ("misc.project.roots");
+ }
+
+
+ public Collection getChildren(Object parent) {
+ if (parent instanceof Project) {
+ return Model.getFacade().getRootElements();
+ }
+ return null;
+ }
+
+
+ public Set getDependencies(Object parent) {
+ return null;
+ }
+}
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.