001: /*
002: * Copyright 2001-2006 C:1 Financial Services GmbH
003: *
004: * This software is free software; you can redistribute it and/or
005: * modify it under the terms of the GNU Lesser General Public
006: * License Version 2.1, as published by the Free Software Foundation.
007: *
008: * This software is distributed in the hope that it will be useful,
009: * but WITHOUT ANY WARRANTY; without even the implied warranty of
010: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
011: * Lesser General Public License for more details.
012: *
013: * You should have received a copy of the GNU Lesser General Public
014: * License along with this library; if not, write to the Free Software
015: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
016: */
017:
018: package de.finix.contelligent.client.gui;
019:
020: import javax.swing.Action;
021: import javax.swing.JPanel;
022:
023: import de.finix.contelligent.client.base.ContelligentComponent;
024: import de.finix.contelligent.client.modules.Module;
025:
026: public interface View extends Module {
027:
028: public void setActions(Action[] actions);
029:
030: public void setActionBundle(String bundleName, Action[] actions);
031:
032: public void removeActionBundle(String bundleName);
033:
034: /**
035: * Returns true, if the user already started an editing process on a
036: * component in this view.
037: */
038: public boolean isEditInProgress();
039:
040: public ComponentEditor[] getEditors();
041:
042: public void makeEditorVisible(ComponentEditor editor);
043:
044: public void render();
045:
046: public void edit();
047:
048: public boolean lockSubtree();
049:
050: public boolean unlockSubtree();
051:
052: public boolean lockSubtree(ContelligentComponent component);
053:
054: public boolean unlockSubtree(ContelligentComponent component);
055:
056: /**
057: * Starts an edit session on the selected component.
058: */
059: public void begin();
060:
061: /**
062: * This method commits the changes on all components that have been modified
063: * in the current edit session.
064: */
065: public void commit();
066:
067: public void runOnceAfterCommit(Runnable runnable);
068:
069: public void runAlwaysAfterCommit(Runnable runnable);
070:
071: public void dontRunAfterCommitAnymore(Runnable runnable);
072:
073: /**
074: * This method discards all changes of the current edit session by calling
075: * the rollback-method on all participated editors.
076: */
077: public void rollback();
078:
079: /**
080: * Sets the selected component. This component will be edited if the user
081: * starts editing.
082: */
083: public void setComponent(ContelligentComponent component);
084:
085: /**
086: * Gets the selected component. This component will be edited if the user
087: * starts editing.
088: */
089: public ContelligentComponent getComponent();
090:
091: /**
092: * Sets the panel where the gui of the selected component shall be painted.
093: */
094: public void setGUIPanel(JPanel guiPanel);
095:
096: /**
097: * Sets the path of the view component
098: *
099: * @param path
100: * the path of the component that represents this view (e.g.
101: * /system/views/default)
102: */
103: public void setPath(String path);
104:
105: /**
106: * Returns the path of the view component
107: *
108: * @return the path of the component that represents this view (e.g.
109: * /system/views/default)
110: */
111: public String getPath();
112:
113: public GUIMapping getGUIMapping();
114:
115: public GUIDescription getRootGUIDescription();
116:
117: public String getAllowedTypesString();
118:
119: public String getFavoriteTypesString();
120:
121: public boolean getAllowEditInWorkflowOnly();
122:
123: public boolean getAllowCommit();
124:
125: public boolean getAllowBlueprintDefinition();
126:
127: public String getEnvironment();
128:
129: /**
130: * Full featured navigation wrapper. This method attempts to navigate to the target component
131: * in all elements of the view that support such navigation. The exact meaning of navigating to
132: * a component and opening a component may differ between View implementations.
133: *
134: * @param path The path of the target component.
135: * @param attemptOpen If this is set to true, an attempt to open the target component is made.
136: */
137: public void navigate(String path, boolean attemptOpen);
138: }
|