]>
git.argeo.org Git - gpl/argeo-jcr.git/blob - swt/org.argeo.cms.jcr.ui/src/org/argeo/cms/ui/eclipse/forms/editor/IFormPage.java
1 package org
.argeo
.cms
.ui
.eclipse
.forms
.editor
;
2 import org
.argeo
.cms
.ui
.eclipse
.forms
.IManagedForm
;
3 import org
.eclipse
.swt
.widgets
.Control
;
5 * Interface that all GUI pages need to implement in order
6 * to be added to FormEditor part. The interface makes
9 * <li>The form page has a managed form</li>
10 * <li>The form page has a unique id</li>
11 * <li>The form page can be GUI but can also wrap a complete
12 * editor class (in that case, it should return <code>true</code>
13 * from <code>isEditor()</code> method).</li>
14 * <li>The form page is lazy i.e. understands that
15 * its part control will be created at the last possible
18 * <p>Existing editors can be wrapped by implementing
19 * this interface. In this case, 'isEditor' should return <code>true</code>.
20 * A common editor to wrap in <code>TextEditor</code> that is
21 * often added to show the raw source code of the file open into
22 * the multi-page editor.
26 public interface IFormPage
{
29 * the form editor that this page belongs to
31 void initialize(FormEditor editor
);
33 * Returns the editor this page belongs to.
35 * @return the form editor
37 FormEditor
getEditor();
39 * Returns the managed form of this page, unless this is a source page.
41 * @return the managed form or <samp>null </samp> if this is a source page.
43 IManagedForm
getManagedForm();
45 * Indicates whether the page has become the active in the editor. Classes
46 * that implement this interface may use this method to commit the page (on
47 * <code>false</code>) or lazily create and/or populate the content on
51 * <code>true</code> if page should be visible, <code>false</code>
54 void setActive(boolean active
);
56 * Returns <samp>true </samp> if page is currently active, false if not.
58 * @return <samp>true </samp> for active page.
62 * Tests if the content of the page is in a state that allows the
63 * editor to flip to another page. Typically, pages that contain
64 * raw source with syntax errors should not allow editors to
65 * leave them until errors are corrected.
66 * @return <code>true</code> if the editor can flip to another page,
67 * <code>false</code> otherwise.
69 boolean canLeaveThePage();
71 * Returns the control associated with this page.
73 * @return the control of this page if created or <samp>null </samp> if the
74 * page has not been shown yet.
76 Control
getPartControl();
78 * Page must have a unique id that can be used to show it without knowing
79 * its relative position in the editor.
81 * @return the unique page identifier
85 * Returns the position of the page in the editor.
87 * @return the zero-based index of the page in the editor.
91 * Sets the position of the page in the editor.
94 * the zero-based index of the page in the editor.
96 void setIndex(int index
);
98 * Tests whether this page wraps a complete editor that
99 * can be registered on its own, or represents a page
100 * that cannot exist outside the multi-page editor context.
102 * @return <samp>true </samp> if the page wraps an editor,
103 * <samp>false </samp> if this is a form page.
107 * A hint to bring the provided object into focus. If the object is in a
108 * tree or table control, select it. If it is shown on a scrollable page,
109 * ensure that it is visible. If the object is not presented in
110 * the page, <code>false</code> should be returned to allow another
114 * object to select and reveal
115 * @return <code>true</code> if the request was successful, <code>false</code>
118 boolean selectReveal(Object object
);