Package org.eclipse.equinox.p2.ui
Class RepositoryManipulationPage
java.lang.Object
org.eclipse.jface.dialogs.DialogPage
org.eclipse.jface.preference.PreferencePage
org.eclipse.equinox.p2.ui.RepositoryManipulationPage
- All Implemented Interfaces:
ICopyable,IDialogPage,IMessageProvider,IPreferencePage,IWorkbenchPreferencePage
public class RepositoryManipulationPage
extends PreferencePage
implements IWorkbenchPreferencePage, ICopyable
Page that allows users to update, add, remove, import, and
export repositories. This page can be hosted inside a preference
dialog or inside its own dialog.
When hosting this page inside a non-preference dialog, some of the
dialog methods will likely have to call page methods. The following
snippet shows how to host this page inside a TitleAreaDialog.
TitleAreaDialog dialog = new TitleAreaDialog(shell) {
RepositoryManipulationPage page;
protected Control createDialogArea(Composite parent) {
page = new RepositoryManipulationPage();
page.setProvisioningUI(ProvisioningUI.getDefaultUI());
page.createControl(parent);
this.setTitle("Software Sites");
this.setMessage("The enabled sites will be searched for software. Disabled sites are ignored.");
return page.getControl();
}
protected void okPressed() {
if (page.performOk())
super.okPressed();
}
protected void cancelPressed() {
if (page.performCancel())
super.cancelPressed();
}
};
dialog.open();
- Since:
- 2.0
- Restriction:
- This class is not intended to be subclassed by clients.
-
Field Summary
Fields inherited from interface org.eclipse.jface.dialogs.IMessageProvider
ERROR, INFORMATION, NONE, WARNING -
Constructor Summary
ConstructorsConstructorDescriptionCreate a repository manipulation page that will display the repositories available to the user. -
Method Summary
Modifier and TypeMethodDescriptionvoidcopyToClipboard(Control activeControl) Copy text related to the active control to the clipboard.protected ControlcreateContents(Composite parent) Creates and returns the SWT control for the customized body of this preference page under the given parent composite.voidinit(IWorkbench workbench) Initializes this preference page for the given workbench.booleanNotifies that the OK button of this page's container has been pressed.voidSet the provisioning UI that provides the session, policy, and other services for the UI.Methods inherited from class org.eclipse.jface.preference.PreferencePage
applyData, applyDialogFont, computeSize, contributeButtons, createControl, createDescriptionLabel, createNoteComposite, doComputeSize, doGetPreferenceStore, getApplyButton, getContainer, getDefaultsButton, getPreferenceStore, isValid, noDefaultAndApplyButton, noDefaultButton, okToLeave, performApply, performCancel, performDefaults, performHelp, setContainer, setErrorMessage, setMessage, setPreferenceStore, setSize, setTitle, setValid, toString, updateApplyButtonMethods inherited from class org.eclipse.jface.dialogs.DialogPage
convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, dispose, getControl, getDescription, getDialogFontName, getErrorMessage, getFont, getImage, getMessage, getMessageType, getShell, getTitle, getToolTipText, initializeDialogUnits, isControlCreated, setButtonLayoutData, setControl, setDescription, setImageDescriptor, setMessage, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jface.dialogs.IDialogPage
createControl, dispose, getControl, getDescription, getErrorMessage, getImage, getMessage, getTitle, performHelp, setDescription, setImageDescriptor, setTitle, setVisibleMethods inherited from interface org.eclipse.jface.preference.IPreferencePage
computeSize, isValid, okToLeave, performCancel, setContainer, setSize
-
Constructor Details
-
RepositoryManipulationPage
public RepositoryManipulationPage()Create a repository manipulation page that will display the repositories available to the user.
-
-
Method Details
-
setProvisioningUI
Set the provisioning UI that provides the session, policy, and other services for the UI. This method must be called before the contents are created or it will have no effect.- Parameters:
ui- the provisioning UI to use for this page.
-
createContents
Description copied from class:PreferencePageCreates and returns the SWT control for the customized body of this preference page under the given parent composite.This framework method must be implemented by concrete subclasses. Any subclass returning a
Compositeobject whoseLayouthas default margins (for example, aGridLayout) is expected to set the margins of thisLayoutto 0 pixels.- Specified by:
createContentsin classPreferencePage- Parameters:
parent- the parent composite- Returns:
- the new control
-
performOk
public boolean performOk()Description copied from interface:IPreferencePageNotifies that the OK button of this page's container has been pressed.- Specified by:
performOkin interfaceIPreferencePage- Overrides:
performOkin classPreferencePage- Returns:
falseto abort the container's OK processing andtrueto allow the OK to happen
-
init
Description copied from interface:IWorkbenchPreferencePageInitializes this preference page for the given workbench.This method is called automatically as the preference page is being created and initialized. Clients must not call this method.
- Specified by:
initin interfaceIWorkbenchPreferencePage- Parameters:
workbench- the workbench
-
copyToClipboard
Description copied from interface:ICopyableCopy text related to the active control to the clipboard.- Specified by:
copyToClipboardin interfaceICopyable- Parameters:
activeControl- the active control
-