01: /*
02: * The contents of this file are subject to the terms of the Common Development
03: * and Distribution License (the License). You may not use this file except in
04: * compliance with the License.
05: *
06: * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
07: * or http://www.netbeans.org/cddl.txt.
08: *
09: * When distributing Covered Code, include this CDDL Header Notice in each file
10: * and include the License file at http://www.netbeans.org/cddl.txt.
11: * If applicable, add the following below the CDDL Header, with the fields
12: * enclosed by brackets [] replaced by your own identifying information:
13: * "Portions Copyrighted [year] [name of copyright owner]"
14: *
15: * The Original Software is NetBeans. The Initial Developer of the Original
16: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
17: * Microsystems, Inc. All Rights Reserved.
18: */
19: package org.netbeans.modules.soa.ui.form;
20:
21: import org.netbeans.modules.soa.ui.form.valid.ValidStateManager;
22: import org.openide.nodes.Node;
23: import org.openide.util.HelpCtx;
24: import org.openide.util.Lookup;
25:
26: /**
27: * This interface describe subsidiary methods for a Custom Editor which
28: * is intended to show property of a Node.
29: *
30: * @author nk160297
31: */
32: public interface CustomNodeEditor<T> extends EditorLifeCycle,
33: Lookup.Provider, ValidStateManager.Provider, HelpCtx.Provider {
34:
35: /**
36: * This string is used as a key to set property to different UI controls
37: * which should be bound to a Node.Property.
38: */
39: String PROPERTY_BINDER = "PropertyBinder"; // NOI18N
40:
41: /**
42: * Returns the Node which properties the editor shows.
43: */
44: Node getEditedNode();
45:
46: /**
47: * Returns the original object which is edited
48: */
49: T getEditedObject();
50:
51: /**
52: * This method does part of standard steps to process Ok button.
53: * It is intended to be used internally by the NodeEditorDescriptor only.
54: * It's recommend to avoid using the method.
55: * Returns the success flag.
56: */
57: boolean doValidateAndSave();
58:
59: /**
60: * Indicates the current editting mode of the editor.
61: */
62: EditingMode getEditingMode();
63:
64: /**
65: * This method change the current editing mode.
66: * It should be used carefully!
67: * Usually the editing mode can be change at initialization stage.
68: */
69: void setEditingMode(EditingMode newValue);
70:
71: enum EditingMode {
72: NOT_SPECIFIED, CREATE_NEW_INSTANCE, // The editor shows an object which is just created.
73: EDIT_INSTANCE
74: // The editor shows an old object.
75: };
76:
77: interface Owner {
78: void setEditor(CustomNodeEditor editor);
79:
80: CustomNodeEditor getEditor();
81: }
82: }
|