01: /*
02: * Copyright 2001-2006 C:1 Financial Services GmbH
03: *
04: * This software is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License Version 2.1, as published by the Free Software Foundation.
07: *
08: * This software is distributed in the hope that it will be useful,
09: * but WITHOUT ANY WARRANTY; without even the implied warranty of
10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11: * Lesser General Public License for more details.
12: *
13: * You should have received a copy of the GNU Lesser General Public
14: * License along with this library; if not, write to the Free Software
15: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
16: */
17:
18: package de.finix.contelligent.client.gui.directory;
19:
20: import java.awt.dnd.DnDConstants;
21:
22: import de.finix.contelligent.client.gui.AbstractGUIWithCommonRendererAndEditor;
23: import de.finix.contelligent.client.gui.ComponentEditor;
24: import de.finix.contelligent.client.gui.explorer.ExplorerEditor;
25: import de.finix.contelligent.client.i18n.Resources;
26:
27: /**
28: * Available to the end user as "ExpertTree". (We cant rename the classes
29: * themselves since old configuration data might refer to them)
30: *
31: * Options are: Expert mode (all actions available, does not hide subcomponents)
32: */
33: public class ExpertTreeGUI extends
34: AbstractGUIWithCommonRendererAndEditor {
35:
36: protected ComponentEditor createEditor(boolean editable) {
37: ComponentFilter filter = new ComponentFilter(true);
38: DirectoryEditor editor = new DirectoryEditor();
39: editor.setComponent(getComponent());
40: editor.setView(getView());
41: ExplorerEditor explorerEditor = new ExplorerEditor();
42: explorerEditor.setComponent(getComponent());
43: explorerEditor.setView(getView());
44: explorerEditor.setEditable(true);
45: explorerEditor.setPreviewEditListener(true);
46: explorerEditor.setGuiContainer(editor);
47: explorerEditor.setPathSelectionManager(editor);
48: explorerEditor.setBrowseMode(ExplorerEditor.TREE_VIEW);
49: explorerEditor.setMode(ExplorerEditor.EXPERT_MODE);
50: explorerEditor.setFilter(filter);
51: explorerEditor.setDragAndDropActions(DnDConstants.ACTION_COPY
52: | DnDConstants.ACTION_LINK | DnDConstants.ACTION_MOVE);
53: explorerEditor.setIsRootVisible(true);
54: explorerEditor.init();
55: editor.setSelectionPanel(explorerEditor);
56: editor.init();
57: explorerEditor.initialSelect();
58: return editor;
59: }
60:
61: public boolean isSupported(int type) {
62: return (type == DEFAULT);
63: }
64:
65: public boolean hidesSubcomponents() {
66: return false;
67: }
68:
69: public String getName() {
70: return Resources.getLocalString("tree_gui");
71: }
72: }
|