01: package net.refractions.udig.style.sld.editor.internal;
02:
03: import net.refractions.udig.style.sld.IEditorPage;
04: import net.refractions.udig.style.sld.IEditorPageContainer;
05:
06: import org.eclipse.swt.graphics.Image;
07: import org.eclipse.swt.widgets.Composite;
08:
09: public interface IEditorNode {
10: /**
11: * Adds the given preference node as a subnode of this
12: * preference node.
13: *
14: * @param node the node to add
15: */
16: public void add(IEditorNode node);
17:
18: /**
19: * Creates the preference page for this node.
20: */
21: public void createPage(Composite parent,
22: IEditorPageContainer container);
23:
24: /**
25: * Release the page managed by this node, and any SWT resources
26: * held onto by this node (Images, Fonts, etc).
27: *
28: * Note that nodes are reused so this is not a call to dispose the
29: * node itself.
30: */
31: public void disposeResources();
32:
33: /**
34: * Returns the subnode of this contribution node with the given node id.
35: *
36: * @param id the preference node id
37: * @return the subnode, or <code>null</code> if none
38: */
39: public IEditorNode findSubNode(String id);
40:
41: /**
42: * Returns the id of this contribution node.
43: * This id identifies a contribution node relative to its parent.
44: *
45: * @return the node id
46: */
47: public String getId();
48:
49: /**
50: * Returns the image used to present this node in a preference dialog.
51: *
52: * @return the image for this node, or <code>null</code>
53: * if there is no image for this node
54: */
55: public Image getLabelImage();
56:
57: /**
58: * Returns the text label used to present this node in a preference dialog.
59: *
60: * @return the text label for this node, or <code>null</code>
61: * if there is no label for this node
62: */
63: public String getLabelText();
64:
65: /**
66: * Returns the preference page for this node.
67: *
68: * @return the preference page
69: */
70: public IEditorPage getPage();
71:
72: /**
73: * Returns an iterator over the subnodes (immediate children)
74: * of this contribution node.
75: *
76: * @return an IEditorNode array containing the child nodes
77: */
78: public IEditorNode[] getSubNodes();
79:
80: /**
81: * Removes the subnode of this preference node with the given node id.
82: *
83: * @param id the subnode id
84: * @return the removed subnode, or <code>null</code> if none
85: */
86: public IEditorNode remove(String id);
87:
88: /**
89: * Removes the given preference node from the list of subnodes
90: * (immediate children) of this node.
91: *
92: * @param node the node to remove
93: * @return <code>true</code> if the node was removed,
94: * and <code>false</code> otherwise
95: */
96: public boolean remove(IEditorNode node);
97:
98: }
|