public final class DetailsPart extends Object implements IFormPart, IPartSelectionListener
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 |
---|
DetailsPart(IManagedForm mform,
Composite parent,
int style)
Creates a new details part in the provided form by creating
the page book.
|
DetailsPart(IManagedForm mform,
ScrolledPageBook pageBook)
Creates a details part by wrapping the provided page book.
|
Modifier and Type | Method and Description |
---|---|
void |
commit(boolean onSave)
Commits the part by committing the current page.
|
void |
dispose()
Disposes the part allowing it to release allocated resources.
|
IDetailsPage |
getCurrentPage()
Returns the current page visible in the part.
|
int |
getPageLimit()
Returns the maximum number of pages that should be
maintained in this part.
|
void |
initialize(IManagedForm form)
Initializes the 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.
|
void |
registerPage(Object objectClass,
IDetailsPage page)
Registers the details page to be used for all the objects of
the provided object class.
|
void |
selectionChanged(IFormPart part,
ISelection selection)
Called when the provided part has changed selection state.
|
void |
setFocus()
Sets the focus to the currently visible page.
|
boolean |
setFormInput(Object input)
Notifies the part that an object has been set as overall form's input.
|
void |
setPageLimit(int pageLimit)
Sets the page limit for this part.
|
void |
setPageProvider(IDetailsPageProvider provider)
Sets the dynamic page provider.
|
public DetailsPart(IManagedForm mform, ScrolledPageBook pageBook)
mform
- the parent formpageBook
- the page book to wrappublic DetailsPart(IManagedForm mform, Composite parent, int style)
mform
- the parent formparent
- the composite to create the page book instyle
- the style for the page bookpublic void registerPage(Object objectClass, IDetailsPage 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 setPageProvider(IDetailsPageProvider provider)
provider
- the provider to usepublic void commit(boolean onSave)
public IDetailsPage getCurrentPage()
public void dispose()
IFormPart
public void initialize(IManagedForm form)
IFormPart
initialize
in interface IFormPart
form
- the managed form that manages the partpublic boolean isDirty()
public boolean isStale()
public void refresh()
public void setFocus()
public boolean setFormInput(Object input)
IFormPart
setFormInput
in interface IFormPart
true
if the part has selected and revealed the
input object, false
otherwise.public void selectionChanged(IFormPart part, ISelection selection)
IPartSelectionListener
selectionChanged
in interface IPartSelectionListener
part
- the selection sourceselection
- the new selectionpublic int getPageLimit()
public void setPageLimit(int pageLimit)
pageLimit
- the maximum number of pages that
should be maintained in this part.getPageLimit()
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.