01: /* ====================================================================
02: * The JRefactory License, Version 1.0
03: *
04: * Copyright (c) 2001 JRefactory. All rights reserved.
05: *
06: * Redistribution and use in source and binary forms, with or without
07: * modification, are permitted provided that the following conditions
08: * are met:
09: *
10: * 1. Redistributions of source code must retain the above copyright
11: * notice, this list of conditions and the following disclaimer.
12: *
13: * 2. Redistributions in binary form must reproduce the above copyright
14: * notice, this list of conditions and the following disclaimer in
15: * the documentation and/or other materials provided with the
16: * distribution.
17: *
18: * 3. The end-user documentation included with the redistribution,
19: * if any, must include the following acknowledgment:
20: * "This product includes software developed by the
21: * JRefactory (http://www.sourceforge.org/projects/jrefactory)."
22: * Alternately, this acknowledgment may appear in the software itself,
23: * if and wherever such third-party acknowledgments normally appear.
24: *
25: * 4. The names "JRefactory" must not be used to endorse or promote
26: * products derived from this software without prior written
27: * permission. For written permission, please contact seguin@acm.org.
28: *
29: * 5. Products derived from this software may not be called "JRefactory",
30: * nor may "JRefactory" appear in their name, without prior written
31: * permission of Chris Seguin.
32: *
33: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
34: * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
35: * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
36: * DISCLAIMED. IN NO EVENT SHALL THE CHRIS SEGUIN OR
37: * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
38: * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
39: * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
40: * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
41: * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
42: * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
43: * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
44: * SUCH DAMAGE.
45: * ====================================================================
46: *
47: * This software consists of voluntary contributions made by many
48: * individuals on behalf of JRefactory. For more information on
49: * JRefactory, please see
50: * <http://www.sourceforge.org/projects/jrefactory>.
51: */
52: package org.acm.seguin.ide.jbuilder;
53:
54: import com.borland.primetime.actions.ActionGroup;
55: import com.borland.primetime.ide.Browser;
56: import com.borland.primetime.ide.ContextActionProvider;
57: import com.borland.primetime.node.Node;
58: import javax.swing.Action;
59: import org.acm.seguin.ide.jbuilder.refactor.JBuilderAddChildClassAction;
60: import org.acm.seguin.ide.jbuilder.refactor.JBuilderAddParentClassAction;
61: import org.acm.seguin.ide.jbuilder.refactor.JBuilderExtractInterfaceAction;
62: import org.acm.seguin.ide.jbuilder.refactor.JBuilderMoveClassAction;
63: import org.acm.seguin.ide.jbuilder.refactor.JBuilderRemoveClassAction;
64: import org.acm.seguin.ide.jbuilder.refactor.JBuilderRenameClassAction;
65:
66: /**
67: * Adds the refactorings onto the project view
68: *
69: *@author Chris Seguin
70: *@created October 18, 2001
71: */
72: public class ProjectViewRefactorings implements ContextActionProvider {
73: /**
74: * Gets the ContextAction attribute of the ProjectViewRefactorings object
75: *
76: *@param browser Description of Parameter
77: *@param nodes Description of Parameter
78: *@return The ContextAction value
79: */
80: public Action getContextAction(Browser browser, Node[] nodes) {
81: ActionGroup group = new ActionGroup("JRefactory");
82: group.setPopup(true);
83:
84: group.add(new JBuilderRenameClassAction(nodes));
85: group.add(new JBuilderMoveClassAction(nodes));
86: group.add(new JBuilderAddParentClassAction(nodes));
87: group.add(new JBuilderAddChildClassAction(nodes));
88: group.add(new JBuilderRemoveClassAction(nodes));
89: group.add(new JBuilderExtractInterfaceAction(nodes));
90:
91: return group;
92: }
93: }
94: // EOF
|