public class EditorPartBook extends AbstractEditorPart implements org.eclipse.jface.viewers.ISelectionChangedListener
By default, details part accepts any number of pages. If dynamic page provider is registered, this number may be excessive. To avoid running out of steam (by creating a large number of pages with widgets on each), maximum number of pages can be set to some reasonable value (e.g. 10). When this number is reached, old pages (those created first) will be removed and disposed as new ones are added. If the disposed pages are needed again after that, they will be created again.
| Constructor and Description |
|---|
EditorPartBook(boolean commitIfDirty)
Creates a details part by wrapping the provided page book.
|
EditorPartBook(boolean commitIfDirty,
int style) |
| Modifier and Type | Method and Description |
|---|---|
void |
commit(boolean onSave)
Commits the part by committing the current page.
|
protected void |
commitPart(org.eclipse.jface.viewers.ISelection selection,
IEditorPart detailsPart,
boolean onSave) |
void |
createContents(org.eclipse.swt.widgets.Composite parent) |
void |
dispose() |
org.eclipse.swt.widgets.Control |
getControl() |
IEditorPart |
getCurrentPart()
Returns the current page visible in the part.
|
int |
getPartLimit()
Returns the maximum number of pages that should be maintained in this
part.
|
boolean |
isDirty()
Tests if the currently visible page is dirty.
|
boolean |
isStale()
Tests if the currently visible page is stale and needs refreshing.
|
void |
refresh()
Refreshes the current page.
|
protected void |
refreshPart(IEditorPart detailsPart) |
void |
registerPart(Class<?> objectClass,
IEditorPart page)
Registers the details part to be used for all the objects of the provided
object class.
|
void |
selectionChanged(org.eclipse.jface.viewers.ISelection selection) |
void |
selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event) |
boolean |
setEditorInput(Object input) |
boolean |
setFocus()
Sets the focus to the currently visible page.
|
void |
setInput(Object input) |
void |
setPartLimit(int partLimit)
Sets the page limit for this part.
|
void |
setPartProvider(IEditorPartProvider provider)
Sets the dynamic page provider.
|
activate, addPart, addPart, addTextBorder, asyncExec, commitParts, deactivate, disposeParts, getForm, getIgnoreChanges, getParts, getShell, getWidgetFactory, initialize, initialize, refreshParts, removePart, setDirty, setIgnoreChanges, setStale, syncExecpublic EditorPartBook(boolean commitIfDirty)
mform - the parent formscrolledPageBook - the page book to wrappublic EditorPartBook(boolean commitIfDirty,
int style)
public void registerPart(Class<?> objectClass, IEditorPart page)
objectClass - an object of type 'java.lang.Class' to be used as a key for
the provided pagepage - the page to show for objects of the provided object classpublic void setPartProvider(IEditorPartProvider provider)
provider - the provider to usepublic void commit(boolean onSave)
commit in interface IEditorPartcommit in class AbstractEditorPartonSave - true if commit is requested as a result of the
'save' action, false otherwise.public IEditorPart getCurrentPart()
public void dispose()
dispose in interface IEditorPartdispose in class AbstractEditorPartpublic boolean isDirty()
isDirty in interface IEditorPartisDirty in class AbstractEditorParttrue if the page is dirty, false
otherwise.public boolean isStale()
isStale in interface IEditorPartisStale in class AbstractEditorParttrue if the page is stale, false
otherwise.public void refresh()
refresh in interface IEditorPartrefresh in class AbstractEditorPartpublic boolean setFocus()
setFocus in interface IEditorPartsetFocus in class AbstractEditorPartpublic org.eclipse.swt.widgets.Control getControl()
public boolean setEditorInput(Object input)
setEditorInput in interface IEditorPartsetEditorInput in class AbstractEditorPartpublic void selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event)
selectionChanged in interface org.eclipse.jface.viewers.ISelectionChangedListenerpublic void selectionChanged(org.eclipse.jface.viewers.ISelection selection)
protected void refreshPart(IEditorPart detailsPart)
protected void commitPart(org.eclipse.jface.viewers.ISelection selection,
IEditorPart detailsPart,
boolean onSave)
public int getPartLimit()
public void setPartLimit(int partLimit)
partLimit - the maximum number of pages that should be maintained in this
part.getPartLimit()public void createContents(org.eclipse.swt.widgets.Composite parent)
createContents in interface IEditorPartpublic void setInput(Object input)
setInput in interface IEditorPartsetInput in class AbstractEditorPartCopyright © 2022 Fraunhofer IWU. All rights reserved.