Class NewScopedElementWizardPage
java.lang.Object
org.eclipse.jface.dialogs.DialogPage
org.eclipse.jface.wizard.WizardPage
org.libreoffice.ide.eclipse.core.wizards.pages.NewScopedElementWizardPage
- All Implemented Interfaces:
org.eclipse.jface.dialogs.IDialogPage,org.eclipse.jface.dialogs.IMessageProvider,org.eclipse.jface.wizard.IWizardPage,IFieldChangedListener,IListenablePage
- Direct Known Subclasses:
NewInterfaceWizardPage,NewServiceWizardPage
public abstract class NewScopedElementWizardPage
extends org.eclipse.jface.wizard.WizardPage
implements IFieldChangedListener, IListenablePage
Abstract class for a wizard page to create a scoped element such as a service or an interface.
-
Field Summary
Fields inherited from interface org.eclipse.jface.dialogs.IMessageProvider
ERROR, INFORMATION, NONE, WARNING -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor to use when neither the project nor the OOo instance is known.NewScopedElementWizardPage(String pageName, String rootName, String elementName, IOOo instance) Constructor to use when the UNO project is already created, the scoped type name and it's path already known.NewScopedElementWizardPage(String pageName, IOOo instance) Creates a default scoped name type wizard page with blank container path and type name.NewScopedElementWizardPage(String pageName, IUnoidlProject unoProject) Constructor to use when the UNO project is already created.NewScopedElementWizardPage(String pageName, IUnoidlProject project, String rootName, String elementName) Constructor to use when the UNO project is already created, the scoped type name and it's path already known. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPageListener(IPageListener listener) Add the page listener.voidcreateControl(org.eclipse.swt.widgets.Composite pParent) protected abstract voidcreateSpecificControl(org.eclipse.swt.widgets.Composite pParent) Implement this method to add specific controls for the subclassing wizard page.voiddispose()static booleanexistsIdlFile(String idlFullName, IUnoidlProject pPrj) Checks if an IDL file exists in the project for a given IDL type.voidfieldChanged(FieldEvent event) Method called when the row has changed.fillData(UnoFactoryData data) protected voidNotifies all the page listeners that the pages data have changed.abstract UnoFactoryDataCreates an empty factory data for the page UNO type.protected abstract org.eclipse.jface.resource.ImageDescriptorabstract intstatic UnoFactoryDatagetTypeData(UnoFactoryData data) protected abstract StringbooleanbooleanvoidremovePageListener(IPageListener listener) Remove the page listener.voidSets the name of the element to create.voidsetOOoInstance(IOOo instance) Set the OOo instance to query the types from.voidsetPackage(String value, boolean forced) the container name of the type to create is composed of two parts: the package root and the package.voidsetPackageRoot(String pValue) The container name of the type to create is composed of two parts: the package root and the package; this method sets the first part.voidsetPublished(boolean value, boolean forced) Sets whether the type is published or not.voidsetUnoidlProject(IUnoidlProject pUnoProject) Sets the UNO project in which to create the scoped name type.voidsetVisible(boolean pVisible) Methods inherited from class org.eclipse.jface.wizard.WizardPage
canFlipToNextPage, getContainer, getDialogSettings, getImage, getName, getNextPage, getPreviousPage, getShell, getWizard, isCurrentPage, setDescription, setErrorMessage, setImageDescriptor, setMessage, setPageComplete, setPreviousPage, setTitle, setWizard, toStringMethods inherited from class org.eclipse.jface.dialogs.DialogPage
convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, getControl, getDescription, getDialogFontName, getErrorMessage, getFont, getMessage, getMessageType, getTitle, getToolTipText, initializeDialogUnits, isControlCreated, performHelp, setButtonLayoutData, setControl, setMessageMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jface.dialogs.IDialogPage
getControl, getDescription, getErrorMessage, getMessage, getTitle, performHelpMethods inherited from interface org.eclipse.jface.wizard.IWizardPage
getMinimumPageSize
-
Constructor Details
-
NewScopedElementWizardPage
Default constructor to use when neither the project nor the OOo instance is known.- Parameters:
name- wizard page name
-
NewScopedElementWizardPage
Constructor to use when the UNO project is already created.- Parameters:
pageName- name of the pageunoProject- UNO project in which to create a scoped type
-
NewScopedElementWizardPage
public NewScopedElementWizardPage(String pageName, IUnoidlProject project, String rootName, String elementName) Constructor to use when the UNO project is already created, the scoped type name and it's path already known.- Parameters:
pageName- name of the wizard pageproject- UNO project in which to create a scoped typerootName- scoped name of the module containing the typeelementName- name of the type, without any '.' or '::'
-
NewScopedElementWizardPage
Creates a default scoped name type wizard page with blank container path and type name.- Parameters:
pageName- name of the wizard pageinstance- the OOo instance to use to retrieve the types
-
NewScopedElementWizardPage
public NewScopedElementWizardPage(String pageName, String rootName, String elementName, IOOo instance) Constructor to use when the UNO project is already created, the scoped type name and it's path already known.- Parameters:
pageName- name of the wizard pagerootName- scoped name of the module containing the typeelementName- name of the type, without any '.' or '::'instance- the reference to the OOo to use for type selection
-
-
Method Details
-
getProject
- Returns:
- the project which has been set to the page
-
getTypeLabel
- Returns:
- the string corresponding to the type name, e.g. "interface".
-
getImageDescriptor
protected abstract org.eclipse.jface.resource.ImageDescriptor getImageDescriptor()- Returns:
- the image descriptor to put on the top-right of the page
-
createSpecificControl
protected abstract void createSpecificControl(org.eclipse.swt.widgets.Composite pParent) Implement this method to add specific controls for the subclassing wizard page.- Parameters:
pParent- the composite parent where to put the controls
-
getProvidedTypes
public abstract int getProvidedTypes()- Returns:
- the types to get in the UNO types provider. The returned integer is a
bit orof the types defined in theUnoTypeProviderclass.
-
setOOoInstance
Set the OOo instance to query the types from.- Parameters:
instance- OOo instance to use.
-
setUnoidlProject
Sets the UNO project in which to create the scoped name type.- Parameters:
pUnoProject- the projet for which to create the UNO type.
-
getPackageRoot
- Returns:
- the root module where to create the UNO type.
-
getPackage
- Returns:
- the module containing the UNO type, separated by "::".
-
getElementName
- Returns:
- the name of the element to create.
-
setPackageRoot
The container name of the type to create is composed of two parts: the package root and the package; this method sets the first part.- Parameters:
pValue- the new package root to set
-
setPackage
the container name of the type to create is composed of two parts: the package root and the package. This method sets the second part.- Parameters:
value- the new package valueforced-truewill replace the current value,falsewill set the value only if the current package is empty ornull.
-
setName
Sets the name of the element to create.- Parameters:
value- the new package valueforced-truewill replace the current value,falsewill set the value only if the current package is empty ornull.
-
isPublished
public boolean isPublished()- Returns:
- whether the service is published or not.
-
setPublished
public void setPublished(boolean value, boolean forced) Sets whether the type is published or not.- Parameters:
value-trueif the type is published,falseotherwiseforced-trueto overwrite the existing value.
-
dispose
public void dispose()- Specified by:
disposein interfaceorg.eclipse.jface.dialogs.IDialogPage- Overrides:
disposein classorg.eclipse.jface.dialogs.DialogPage
-
addPageListener
Add the page listener.- Specified by:
addPageListenerin interfaceIListenablePage- Parameters:
listener- the page listener to add
-
removePageListener
Remove the page listener.- Specified by:
removePageListenerin interfaceIListenablePage- Parameters:
listener- the listener to remove.
-
firePageChanged
Notifies all the page listeners that the pages data have changed.- Parameters:
data- the new data of the page.
-
createControl
public void createControl(org.eclipse.swt.widgets.Composite pParent) - Specified by:
createControlin interfaceorg.eclipse.jface.dialogs.IDialogPage
-
setVisible
public void setVisible(boolean pVisible) - Specified by:
setVisiblein interfaceorg.eclipse.jface.dialogs.IDialogPage- Overrides:
setVisiblein classorg.eclipse.jface.dialogs.DialogPage
-
fillData
- Parameters:
data- the UNO data to complete- Returns:
- the given data with the completed properties,
nullif the provided data isnull
-
getEmptyTypeData
Creates an empty factory data for the page UNO type.- Returns:
- the empty UNO factory data
-
getTypeData
- Parameters:
data- the data of the project for which to get the default type data.- Returns:
- the default type data for the project
-
fieldChanged
Method called when the row has changed.- Specified by:
fieldChangedin interfaceIFieldChangedListener- Parameters:
event- the field event thrown
-
isPageComplete
public boolean isPageComplete()- Specified by:
isPageCompletein interfaceorg.eclipse.jface.wizard.IWizardPage- Overrides:
isPageCompletein classorg.eclipse.jface.wizard.WizardPage
-
existsIdlFile
Checks if an IDL file exists in the project for a given IDL type.Please note that this method behaves correctly only if the user is respecting the following design rules:
- One IDL type per file
- The IDL types have to be organized in directories representing the UNO modules
- Parameters:
idlFullName- the full name of the IDL file checkpPrj- the project where to look for the IDL file- Returns:
trueif the an IDL file corresponds to the searched type,falseotherwise.
-