Eclipse Platform
Release 3.6

org.eclipse.equinox.p2.ui
Class RepositoryManipulationPage

java.lang.Object
  extended by org.eclipse.jface.dialogs.DialogPage
      extended by org.eclipse.jface.preference.PreferencePage
          extended by 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
RepositoryManipulationPage()
          Create a repository manipulation page that will display the repositories available to the user.
 
Method Summary
 void copyToClipboard(Control activeControl)
          Copy text related to the active control to the clipboard.
protected  Control createContents(Composite parent)
          Creates and returns the SWT control for the customized body of this preference page under the given parent composite.
 void init(IWorkbench workbench)
          Initializes this preference page for the given workbench.
 boolean performOk()
          Notifies that the OK button of this page's container has been pressed.
 void setProvisioningUI(ProvisioningUI ui)
          Set 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, okToLeave, performApply, performCancel, performDefaults, performHelp, setContainer, setErrorMessage, setMessage, setPreferenceStore, setSize, setTitle, setValid, toString, updateApplyButton
 
Methods 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, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.jface.preference.IPreferencePage
computeSize, isValid, okToLeave, performCancel, setContainer, setSize
 
Methods inherited from interface org.eclipse.jface.dialogs.IDialogPage
createControl, dispose, getControl, getDescription, getErrorMessage, getImage, getMessage, getTitle, performHelp, setDescription, setImageDescriptor, setTitle, setVisible
 

Constructor Detail

RepositoryManipulationPage

public RepositoryManipulationPage()
Create a repository manipulation page that will display the repositories available to the user.

Method Detail

setProvisioningUI

public void setProvisioningUI(ProvisioningUI ui)
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

protected Control createContents(Composite parent)
Description copied from class: PreferencePage
Creates 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 Composite object whose Layout has default margins (for example, a GridLayout) are expected to set the margins of this Layout to 0 pixels.

Specified by:
createContents in class PreferencePage
Parameters:
parent - the parent composite
Returns:
the new control

performOk

public boolean performOk()
Description copied from interface: IPreferencePage
Notifies that the OK button of this page's container has been pressed.

Specified by:
performOk in interface IPreferencePage
Overrides:
performOk in class PreferencePage
Returns:
false to abort the container's OK processing and true to allow the OK to happen

init

public void init(IWorkbench workbench)
Description copied from interface: IWorkbenchPreferencePage
Initializes 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:
init in interface IWorkbenchPreferencePage
Parameters:
workbench - the workbench

copyToClipboard

public void copyToClipboard(Control activeControl)
Description copied from interface: ICopyable
Copy text related to the active control to the clipboard.

Specified by:
copyToClipboard in interface ICopyable
Parameters:
activeControl - the active control

Eclipse Platform
Release 3.6

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2010. All rights reserved.