org.eclipse.cdt.ui.newui
Class AbstractPage
java.lang.Object
org.eclipse.jface.dialogs.DialogPage
org.eclipse.jface.preference.PreferencePage
org.eclipse.ui.dialogs.PropertyPage
org.eclipse.cdt.ui.newui.AbstractPage
- All Implemented Interfaces:
- ICOptionContainer, ICPropertyProvider, org.eclipse.jface.dialogs.IDialogPage, org.eclipse.jface.dialogs.IMessageProvider, org.eclipse.jface.preference.IPreferencePage, org.eclipse.jface.preference.IPreferencePageContainer, org.eclipse.ui.IWorkbenchPropertyPage
- Direct Known Subclasses:
- AbstractPrefPage, AbstractSinglePage, Page_BuildSettings, Page_Discovery, Page_Environment, Page_ExpPathAndSymb, Page_head_build, Page_PathAndSymb, Page_ToolChain, Page_Variables, PathAndSymbolPage
public abstract class AbstractPage
- extends org.eclipse.ui.dialogs.PropertyPage
- implements org.eclipse.ui.IWorkbenchPropertyPage, org.eclipse.jface.preference.IPreferencePageContainer, ICPropertyProvider
It is a parent for all standard CDT property pages
in new CDT model.
Although it is enougth for new page to implement
"IWorkbenchPropertyPage" interface, it would be
better to extend it from "AbstractPage".
In this case, we'll able to use:
- dynamic tabs support via cPropertyTab extension point
- a lot of utility methods: see ICPropertyProvider interface
- mechanism of messages sent to all pages and all tabs in them
In fact, descendants of AbstractPage have to implement
the only method:
protected boolean isSingle();
It it returns false, current page can contain multiple tabs
(obtained through "cPropertyTab" extension point).
If it returns true, only one content tab is possible. If
more than 1 tabs refer to this pas as a parent, only 1st
one would be taken into account, others will be ignored.
Fields inherited from interface org.eclipse.jface.dialogs.IMessageProvider |
ERROR, INFORMATION, NONE, WARNING |
Methods inherited from class org.eclipse.ui.dialogs.PropertyPage |
setElement |
Methods inherited from class org.eclipse.jface.preference.PreferencePage |
applyData, computeSize, createControl, getContainer, okToLeave, performHelp, setContainer, setErrorMessage, setMessage, setPreferenceStore, setSize, setTitle, setValid, toString |
Methods inherited from class org.eclipse.jface.dialogs.DialogPage |
getControl, getDescription, getErrorMessage, getImage, getMessage, getMessageType, getShell, getTitle, setDescription, setImageDescriptor, setMessage |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.eclipse.ui.IWorkbenchPropertyPage |
setElement |
Methods inherited from interface org.eclipse.jface.preference.IPreferencePage |
computeSize, okToLeave, setContainer, setSize |
Methods inherited from interface org.eclipse.jface.dialogs.IDialogPage |
createControl, getControl, getDescription, getErrorMessage, getImage, getMessage, getTitle, performHelp, setDescription, setImageDescriptor, setTitle |
ELEMENT_NAME
public static final java.lang.String ELEMENT_NAME
- See Also:
- Constant Field Values
CLASS_NAME
public static final java.lang.String CLASS_NAME
- See Also:
- Constant Field Values
PARENT_NAME
public static final java.lang.String PARENT_NAME
- See Also:
- Constant Field Values
IMAGE_NAME
public static final java.lang.String IMAGE_NAME
- See Also:
- Constant Field Values
TIP_NAME
public static final java.lang.String TIP_NAME
- See Also:
- Constant Field Values
TEXT_NAME
public static final java.lang.String TEXT_NAME
- See Also:
- Constant Field Values
WEIGHT_NAME
public static final java.lang.String WEIGHT_NAME
- See Also:
- Constant Field Values
EMPTY_STR
public static final java.lang.String EMPTY_STR
- See Also:
- Constant Field Values
AbstractPage
public AbstractPage()
- Default constructor
createWidgets
public void createWidgets(org.eclipse.swt.widgets.Composite c)
getProject
public org.eclipse.core.resources.IProject getProject()
- Specified by:
getProject
in interface ICOptionContainer
performCancel
public boolean performCancel()
- Specified by:
performCancel
in interface org.eclipse.jface.preference.IPreferencePage
- Overrides:
performCancel
in class org.eclipse.jface.preference.PreferencePage
performDefaults
public void performDefaults()
- Overrides:
performDefaults
in class org.eclipse.jface.preference.PreferencePage
performApply
public void performApply()
- Overrides:
performApply
in class org.eclipse.jface.preference.PreferencePage
performOk
public boolean performOk()
- There are 2 ways to perform OK for CDT property pages.
1st (default):
All pages use the same editable copy of ICProjectDescription.
When OK occurs, this object is simply set.
2nd:
When OK occurs, each page must copy its data to new instance
of ICProjectDescription, like it occurs during Apply event.
It allows to avoid collisions with other property pages,
which do not share ICProjectDescription instance.
But some changes may be saved wrong if they are affected
by data from another property pages (Discovery options etc).
To enable 2nd mode, just create the following file:
/.metadata/.plugins/org.eclipse.cdt.ui/apply_mode
- Specified by:
performOk
in interface org.eclipse.jface.preference.IPreferencePage
- Overrides:
performOk
in class org.eclipse.jface.preference.PreferencePage
updateButtons
public void updateButtons()
- Specified by:
updateButtons
in interface org.eclipse.jface.preference.IPreferencePageContainer
updateMessage
public void updateMessage()
- Specified by:
updateMessage
in interface org.eclipse.jface.preference.IPreferencePageContainer
updateTitle
public void updateTitle()
- Specified by:
updateTitle
in interface org.eclipse.jface.preference.IPreferencePageContainer
updateContainer
public void updateContainer()
- Specified by:
updateContainer
in interface ICOptionContainer
isValid
public boolean isValid()
- Specified by:
isValid
in interface org.eclipse.jface.preference.IPreferencePage
- Overrides:
isValid
in class org.eclipse.jface.preference.PreferencePage
setVisible
public void setVisible(boolean visible)
- Specified by:
setVisible
in interface org.eclipse.jface.dialogs.IDialogPage
- Overrides:
setVisible
in class org.eclipse.jface.dialogs.DialogPage
getPreferenceStore
public org.eclipse.jface.preference.IPreferenceStore getPreferenceStore()
- Specified by:
getPreferenceStore
in interface org.eclipse.jface.preference.IPreferencePageContainer
- Overrides:
getPreferenceStore
in class org.eclipse.jface.preference.PreferencePage
getPreferences
public org.eclipse.core.runtime.Preferences getPreferences()
- Description copied from interface:
ICOptionContainer
- Returns the preference store.
- Specified by:
getPreferences
in interface ICOptionContainer
- Returns:
- the preference store, or
null
if none
enableConfigSelection
public void enableConfigSelection(boolean enable)
- Specified by:
enableConfigSelection
in interface ICPropertyProvider
getCfgsReadOnly
public org.eclipse.cdt.core.settings.model.ICConfigurationDescription[] getCfgsReadOnly(org.eclipse.core.resources.IProject p)
- Returns configuration descriptions for given project
- Specified by:
getCfgsReadOnly
in interface ICPropertyProvider
getCfgsEditable
public org.eclipse.cdt.core.settings.model.ICConfigurationDescription[] getCfgsEditable()
- Returns loaded configuration descriptions for current project
- Specified by:
getCfgsEditable
in interface ICPropertyProvider
isCDTPrj
public static boolean isCDTPrj(org.eclipse.core.resources.IProject p)
- Checks whether project is new CDT project
- Parameters:
p
- - project to check
isCDTProject
public boolean isCDTProject(org.eclipse.core.resources.IProject p)
- Specified by:
isCDTProject
in interface ICPropertyProvider
getResDesc
public org.eclipse.cdt.core.settings.model.ICResourceDescription getResDesc()
- Specified by:
getResDesc
in interface ICPropertyProvider
getResDesc
public org.eclipse.cdt.core.settings.model.ICResourceDescription getResDesc(org.eclipse.cdt.core.settings.model.ICConfigurationDescription cf)
- Specified by:
getResDesc
in interface ICPropertyProvider
dispose
public void dispose()
- Specified by:
dispose
in interface org.eclipse.jface.dialogs.IDialogPage
- Overrides:
dispose
in class org.eclipse.jface.dialogs.DialogPage
getWeight
public static java.lang.String getWeight(org.eclipse.core.runtime.IConfigurationElement e)
informAll
public void informAll(int code,
java.lang.Object data)
- Specified by:
informAll
in interface ICPropertyProvider
informPages
public void informPages(int code,
java.lang.Object data)
- Specified by:
informPages
in interface ICPropertyProvider
handleMessage
public void handleMessage(int code,
java.lang.Object data)
- Specified by:
handleMessage
in interface ICPropertyProvider
getElement
public org.eclipse.core.runtime.IAdaptable getElement()
- Specified by:
getElement
in interface ICPropertyProvider
- Specified by:
getElement
in interface org.eclipse.ui.IWorkbenchPropertyPage
- Overrides:
getElement
in class org.eclipse.ui.dialogs.PropertyPage
isForProject
public boolean isForProject()
- Specified by:
isForProject
in interface ICPropertyProvider
isForFolder
public boolean isForFolder()
- Specified by:
isForFolder
in interface ICPropertyProvider
isForFile
public boolean isForFile()
- Specified by:
isForFile
in interface ICPropertyProvider
isForPrefs
public boolean isForPrefs()
- Specified by:
isForPrefs
in interface ICPropertyProvider
isMultiCfg
public boolean isMultiCfg()
- Specified by:
isMultiCfg
in interface ICPropertyProvider
getMultiCfg
public org.eclipse.cdt.core.settings.model.ICConfigurationDescription[] getMultiCfg()
- Specified by:
getMultiCfg
in interface ICPropertyProvider
isApplicable
public boolean isApplicable()
- Checks whether CDT property pages can be open for given object.
In particular, header files and text files are not allowed.
Note, that org.eclipse.cdt.ui.plugin.xml contains appropriate
filters to avoid displaying CDT pages for unwanted objects.
So this check is only backup, it would prevent from NullPointer
exceptions in case when xml filters were modified somehow.
- Returns:
- - true if element is applicable to CDT pages.
updateViews
public static void updateViews(org.eclipse.core.resources.IResource res)