|
org.netbeans.core.multiview/1 1.29 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.netbeans.core.spi.multiview.text.MultiViewEditorElement
public class MultiViewEditorElement
Standard MultiViewElement to integrate editor with
MultiViews. It can be used directly via a factory method:
@MultiViewElement.Registration(
displayName = "#BUNDLE_KEY",
iconBase = "path/to/some-icon.png",
mimeType = "text/yourmime",
persistenceType = TopComponent.PERSISTENCE_ONLY_OPENED,
preferredID = "yourId",
position = 1000
)
public static MultiViewEditorElement createEditor(Lookup lkp) {
return new MultiViewEditorElement(lkp);
}
Or one can subclass the class, override some methods (it is recommended
to continue to call super implementation) and register the
subclass.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.netbeans.core.spi.multiview.MultiViewElement |
|---|
MultiViewElement.Registration |
| Constructor Summary | |
|---|---|
MultiViewEditorElement(Lookup lookup)
Constructor suitable for use with MultiViewElement.Registration annotation. |
|
| Method Summary | |
|---|---|
CloseOperationState |
canCloseElement()
Element decides if it can be safely closed. |
void |
componentActivated()
Called when this multi view element is activated. |
void |
componentClosed()
Called only when multi view top component was closed. |
void |
componentDeactivated()
Called when this multi view element is deactivated. |
void |
componentHidden()
Called when this MultiViewElement was hidden. |
void |
componentOpened()
Called only when enclosing multi view top component was closed before and now is opened again for the first time. |
void |
componentShowing()
Called when this MultiViewElement is about to be shown. |
void |
ensureVisible()
|
Action[] |
getActions()
Gets the actions which will appear in the popup menu of this component. |
CloneableTopComponent |
getComponent()
|
JEditorPane |
getEditorPane()
|
Lookup |
getLookup()
Lookup for the MultiViewElement. |
JComponent |
getToolbarRepresentation()
Returns the visual component with the multi view element's toolbar.Should be relatively fast as it's called everytime the current perspective is switched. |
UndoRedo |
getUndoRedo()
UndoRedo support, Get the undo/redo support for this element. |
JComponent |
getVisualRepresentation()
Returns Swing visual representation of this multi view element. |
void |
setMultiViewCallback(MultiViewElementCallback callback)
Use the passed in callback instance for manipulating the enclosing multiview component, keep the instance around during lifecycle of the component if you want to automatically switch to this component etc. |
void |
updateName()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MultiViewEditorElement(Lookup lookup)
MultiViewElement.Registration annotation.
The Lookup parameter is expected to contain
CloneableEditorSupport, otherwise it yields an exception
lookup - context for the editor. Should contain instance of CloneableEditorSupport
class
IllegalArgumentException - if CloneableEditorSupport is not present
in provided Lookup| Method Detail |
|---|
public JComponent getVisualRepresentation()
MultiViewElement
getVisualRepresentation in interface MultiViewElementpublic JComponent getToolbarRepresentation()
MultiViewElement
getToolbarRepresentation in interface MultiViewElementpublic Action[] getActions()
MultiViewElementSubclasses are encouraged to use add the default TopComponent actions to the array of their own. These are accessible by calling MultiViewElementCallback.createDefaultActions()
public Action[] getActions() {
Action[] retValue;
// the multiviewObserver was passed to the element in setMultiViewCallback() method.
if (multiViewObserver != null) {
retValue = multiViewObserver.createDefaultActions();
// add you own custom actions here..
} else {
// fallback..
retValue = super.getActions();
}
return retValue;
}
getActions in interface MultiViewElementpublic Lookup getLookup()
MultiViewElement
getLookup in interface MultiViewElementpublic void componentOpened()
MultiViewElement
componentOpened in interface MultiViewElementpublic void componentClosed()
MultiViewElement
componentClosed in interface MultiViewElementpublic void componentShowing()
MultiViewElement
componentShowing in interface MultiViewElementpublic void componentHidden()
MultiViewElement
componentHidden in interface MultiViewElementpublic void componentActivated()
MultiViewElement
componentActivated in interface MultiViewElementpublic void componentDeactivated()
MultiViewElement
componentDeactivated in interface MultiViewElementpublic UndoRedo getUndoRedo()
MultiViewElement
getUndoRedo in interface MultiViewElementpublic void setMultiViewCallback(MultiViewElementCallback callback)
MultiViewElement
setMultiViewCallback in interface MultiViewElementpublic CloseOperationState canCloseElement()
MultiViewElement
canCloseElement in interface MultiViewElementpublic JEditorPane getEditorPane()
getEditorPane in interface CloneableEditorSupport.Panepublic CloneableTopComponent getComponent()
getComponent in interface CloneableEditorSupport.Panepublic void updateName()
updateName in interface CloneableEditorSupport.Panepublic void ensureVisible()
ensureVisible in interface CloneableEditorSupport.Pane
|
org.netbeans.core.multiview/1 1.29 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||