| org.eclipse.ui.examples.readmetool.ReadmeFilePropertyPage2
ReadmeFilePropertyPage2 | public class ReadmeFilePropertyPage2 extends PropertyPage (Code) | | This page will be added to the property page dialog
when "Properties..." popup menu item is selected
for Readme files.
This page demonstrates conditional property pages which look
different depending on the state of the element. In this example,
the arbitrary condition chosen is whether the Readme file is
greater than 256 bytes in length. If it is smaller than 256 bytes
in length, this will be a placeholder page containing
a simple message. If it is 256 bytes or larger, additional
information will be provided. This information is determined at
runtime.
This class may be reused to implement a conditional property page.
The getPageIndex() method tests the condition and returns the
index of the page to create. The createPage*() methods are called
upon to create the actual pages.
|
Method Summary | |
protected Composite | createComposite(Composite parent, int numColumns) Utility method that creates a new composite and
sets up its layout data. | public Control | createContents(Composite parent) | protected Label | createLabel(Composite parent, String text) Utility method that creates a new label and sets up
its layout data. | protected void | createPageOne(Composite panel) Creates the first version of the page. | protected void | createPageTwo(Composite panel) Creates the second version of the page. | protected int | getPageIndex() Returns which page to display. | public boolean | performOk() |
createComposite | protected Composite createComposite(Composite parent, int numColumns)(Code) | | Utility method that creates a new composite and
sets up its layout data.
Parameters: parent - the parent of the composite Parameters: numColumns - the number of columns in the new composite the newly-created composite |
createContents | public Control createContents(Composite parent)(Code) | | (non-Javadoc)
Method declared on PreferencePage
|
createLabel | protected Label createLabel(Composite parent, String text)(Code) | | Utility method that creates a new label and sets up
its layout data.
Parameters: parent - the parent of the label Parameters: text - the text of the label the newly-created label |
createPageOne | protected void createPageOne(Composite panel)(Code) | | Creates the first version of the page. This is a placeholder page which
notified the user that the page is not available.
Parameters: panel - the panel in which to create the page |
createPageTwo | protected void createPageTwo(Composite panel)(Code) | | Creates the second version of the page. This page might contain more information
about the file or other information.
Parameters: panel - the panel in which to create the page |
getPageIndex | protected int getPageIndex()(Code) | | Returns which page to display. This implementation
answers 1 if the size of the Readme file is less than 256 bytes
and 2 otherwise.
the index of the page to display |
performOk | public boolean performOk()(Code) | | (non-Javadoc)
Method declared on PreferencePage
|
|
|