Java 类org.eclipse.jface.preference.IPreferencePage 实例源码

项目:jsweet-eclipse-plugin    文件:FieldEditorProjectPreferencePage.java   
private void configureWorkspaceSettings() {
    String preferenceNodeId = this.getPreferenceNodeId();
    IPreferencePage preferencePage = newPreferencePage();
    final IPreferenceNode preferenceNode = new PreferenceNode(preferenceNodeId, preferencePage);
    PreferenceManager manager = new PreferenceManager();
    manager.addToRoot(preferenceNode);
    final PreferenceDialog dialog = new PreferenceDialog(this.getControl().getShell(), manager);
    BusyIndicator.showWhile(this.getControl().getDisplay(), new Runnable() {
        @Override
        public void run() {
            dialog.create();
            dialog.setMessage(preferenceNode.getLabelText());
            dialog.open();
        }
    });
}
项目:e4-preferences    文件:ContributedPreferenceNode.java   
@Override
public void createPage() {
    // create the page via DI using the OSGi service context
    try {
        IPreferencePage page = ContextInjectionFactory.make(this.pageClass, this.context);
        setPage(page);

        if (getLabelImage() != null) {
            getPage().setImageDescriptor(getImageDescriptor());
        }
        getPage().setTitle(getLabelText());

        ((PreferencePage) getPage()).setPreferenceStore(this.store);
    }
    catch (Exception e) {
        if (this.logger != null) {
            this.logger.log(
                    LogService.LOG_ERROR, 
                    "Error on creating instance of " + this.pageClass.getName(), 
                    e);
        }
    }
}
项目:PDFReporter-Studio    文件:FieldEditorOverlayPage.java   
/**
 * Show a single preference pages
 * 
 * @param id
 *          - the preference page identification
 * @param page
 *          - the preference page
 */
protected void showPreferencePage(String id, IPreferencePage page, final IProject project) {
    final IPreferenceNode targetNode = new PreferenceNode(id, page);
    PreferenceManager manager = new PreferenceManager();
    manager.addToRoot(targetNode);
    Shell shell = getControl().getShell();
    final PreferenceDialog dialog = project == null ? new PreferenceDialog(shell, manager) : new PropertyDialog(shell,
            manager, new StructuredSelection(project));
    BusyIndicator.showWhile(getControl().getDisplay(), new Runnable() {
        public void run() {
            dialog.create();
            dialog.setMessage(targetNode.getLabelText());
            dialog.open();
        }
    });
}
项目:JFaceUtils    文件:EnhancedPreferenceDialog.java   
@Override
protected void handleSave() {
    final Iterator<IPreferenceNode> nodes = getPreferenceManager().getElements(PreferenceManager.PRE_ORDER).iterator();
    while (nodes.hasNext()) {
        final IPreferenceNode node = nodes.next();
        final IPreferencePage page = node.getPage();
        if (page instanceof PreferencePage) {
            final IPreferenceStore store = ((PreferencePage) page).getPreferenceStore();
            if (store != null && store.needsSaving() && store instanceof IPersistentPreferenceStore) {
                try {
                    ((IPersistentPreferenceStore) store).save();
                }
                catch (final IOException ioe) {
                    final String message = JFaceMessages.get("err.preferences.save");
                    logger.log(Level.SEVERE, message, ioe);
                    EnhancedErrorDialog.openError(getShell(), title, message, IStatus.ERROR, ioe, new Image[] { Display.getCurrent().getSystemImage(SWT.ICON_ERROR) });
                }
            }
        }
    }
}
项目:APICloud-Studio    文件:SWTUtil.java   
/**
 * This method allows us to open the preference dialog on the specific page, in this case the perspective page
 * 
 * @param id
 *            the id of pref page to show
 * @param page
 *            the actual page to show Copied from org.eclipse.debug.internal.ui.SWTUtil
 */
public static void showPreferencePage(String id, IPreferencePage page)
{
    final IPreferenceNode targetNode = new PreferenceNode(id, page);
    PreferenceManager manager = new PreferenceManager();
    manager.addToRoot(targetNode);
    final PreferenceDialog dialog = new PreferenceDialog(UIUtils.getActiveShell(), manager);
    BusyIndicator.showWhile(getStandardDisplay(), new Runnable()
    {
        public void run()
        {
            dialog.create();
            dialog.setMessage(targetNode.getLabelText());
            dialog.open();
        }
    });
}
项目:cppcheclipse    文件:FieldEditorOverlayPage.java   
/**
 * Show a single preference pages
 * 
 * @param id
 *            - the preference page identification
 * @param page
 *            - the preference page
 */
protected void showPreferencePage(String id, IPreferencePage page) {
    final IPreferenceNode targetNode = new PreferenceNode(id, page);
    PreferenceManager manager = new PreferenceManager();
    manager.addToRoot(targetNode);
    final PreferenceDialog dialog = new PreferenceDialog(getControl()
            .getShell(), manager);
    BusyIndicator.showWhile(getControl().getDisplay(), new Runnable() {
        public void run() {
            dialog.create();
            dialog.setMessage(targetNode.getLabelText());
            dialog.open();
        }
    });
}
项目:e4-cookbook-migration-guide    文件:ContributedPreferenceNode.java   
public ContributedPreferenceNode(
        String id, String label, 
        ImageDescriptor imageDescriptor, Class<? extends IPreferencePage> pageClass,
        String path, String nodeQualifier) {

    super(id, label, imageDescriptor, pageClass.getName());
    this.path = path;
    this.pageClass = pageClass;

    this.nodeQualifier = nodeQualifier != null ? nodeQualifier : FrameworkUtil.getBundle(pageClass).getSymbolicName();
}
项目:e4-cookbook-migration-guide    文件:PreferenceNodeContribution.java   
public PreferenceNodeContribution(
        String id, 
        String label, 
        ImageDescriptor imageDescriptor,
        Class<? extends IPreferencePage> pageClass, 
        String path,
        String nodeQualifier) {

    this.nodes.add(new ContributedPreferenceNode(id, label, imageDescriptor, pageClass, path, nodeQualifier));
}
项目:e4-cookbook-migration-guide    文件:PreferenceNodeContribution.java   
public void addPreferenceNode(
        String id, 
        String label, 
        ImageDescriptor imageDescriptor,
        Class<? extends IPreferencePage> pageClass, 
        String path,
        String nodeQualifier) {

    this.nodes.add(new ContributedPreferenceNode(id, label, imageDescriptor, pageClass, path, nodeQualifier));
}
项目:Swiper    文件:FieldEditorOverlayPage.java   
/**
 * Show a single preference pages
 * @param id - the preference page identification
 * @param page - the preference page
 */
protected void showPreferencePage(String id, IPreferencePage page) {
    final IPreferenceNode targetNode = new PreferenceNode(id, page);
    PreferenceManager manager = new PreferenceManager();
    manager.addToRoot(targetNode);
    final PreferenceDialog dialog =
        new PreferenceDialog(getControl().getShell(), manager);
    BusyIndicator.showWhile(getControl().getDisplay(), new Runnable() {
        public void run() {
            dialog.create();
            dialog.setMessage(targetNode.getLabelText());
            dialog.open();
        }
    });
}
项目:Swiper    文件:OverlayPage.java   
/**
 * Show a single preference pages
 * @param id - the preference page identification
 * @param page - the preference page
 */
protected void showPreferencePage(String id, IPreferencePage page) {
    final IPreferenceNode targetNode = new PreferenceNode(id, page);
    PreferenceManager manager = new PreferenceManager();
    manager.addToRoot(targetNode);
    final PreferenceDialog dialog =
        new PreferenceDialog(getControl().getShell(), manager);
    BusyIndicator.showWhile(getControl().getDisplay(), new Runnable() {
        public void run() {
            dialog.create();
            dialog.setMessage(targetNode.getLabelText());
            dialog.open();
        }
    });
}
项目:PDFReporter-Studio    文件:OverlayPage.java   
/**
 * Show a single preference pages
 * 
 * @param id
 *          - the preference page identification
 * @param page
 *          - the preference page
 */
protected void showPreferencePage(String id, IPreferencePage page) {
    final IPreferenceNode targetNode = new PreferenceNode(id, page);
    PreferenceManager manager = new PreferenceManager();
    manager.addToRoot(targetNode);
    final PreferenceDialog dialog = new PreferenceDialog(getControl().getShell(), manager);
    BusyIndicator.showWhile(getControl().getDisplay(), new Runnable() {
        public void run() {
            dialog.create();
            dialog.setMessage(targetNode.getLabelText());
            dialog.open();
        }
    });
}
项目:JFaceUtils    文件:EnhancedPreferenceDialog.java   
@Override
protected boolean showPage(final IPreferenceNode node) {
    boolean success = super.showPage(node);
    final IPreferencePage currentPage = getCurrentPage();
    if (currentPage instanceof BasePreferencePage) {
        ((BasePreferencePage) currentPage).updateCrossChildrenStatus();
    }
    return success;
}
项目:osate2-agcl    文件:FieldEditorOverlayPage.java   
protected void showPreferencePage(String id, IPreferencePage page) {
    final IPreferenceNode targetNode = new PreferenceNode(id, page);
    PreferenceManager manager = new PreferenceManager();
    manager.addToRoot(targetNode);
    final PreferenceDialog dialog = 
            new PreferenceDialog(getControl().getShell(), manager);
    BusyIndicator.showWhile(getControl().getDisplay(), new Runnable() {
        public void run() {
            dialog.create();
            dialog.setMessage(targetNode.getLabelText());
            dialog.open();
        }
    });
}
项目:CppStyle    文件:CppStylePropertyPage.java   
/**
 * Creates a new preferences page and opens it
 */
public void configureWorkspaceSettings() {
    // create a new instance of the current class
    IPreferencePage page = new CppStylePerfPage();
    page.setTitle(getTitle());
    // and show it
    showPreferencePage(CppStyleConstants.PerfPageId, page);
}
项目:CppStyle    文件:CppStylePropertyPage.java   
/**
 * Show a single preference pages
 * 
 * @param id
 *            - the preference page identification
 * @param page
 *            - the preference page
 */
protected void showPreferencePage(String id, IPreferencePage page) {
    final IPreferenceNode targetNode = new PreferenceNode(id, page);
    PreferenceManager manager = new PreferenceManager();
    manager.addToRoot(targetNode);
    final PreferenceDialog dialog = new PreferenceDialog(getControl()
            .getShell(), manager);
    BusyIndicator.showWhile(getControl().getDisplay(), new Runnable() {
        public void run() {
            dialog.create();
            dialog.setMessage(targetNode.getLabelText());
            dialog.open();
        }
    });
}
项目:Mailster    文件:ConfigurationDialog.java   
/**
 * Updates the message.
 * 
 * @see org.eclipse.jface.preference.IPreferencePageContainer#updateMessage()
 */
public void updateMessage()
{
    String message = null;
    String errorMessage = null;
    boolean showingError = false;
    IPreferencePage currentPage = this.getCurrentPage();

    if (currentPage != null)
    {
        message = currentPage.getMessage();
        errorMessage = currentPage.getErrorMessage();
    }
    int messageType = IMessageProvider.NONE;
    if (message != null && currentPage instanceof IMessageProvider)
    {
        messageType = ((IMessageProvider) currentPage).getMessageType();
    }

    if (errorMessage == null)
    {
        if (showingError)
        {
            // we were previously showing an error
            showingError = false;
        }
    }
    else
    {
        message = errorMessage;
        messageType = IMessageProvider.ERROR;
        if (!showingError)
        {
            // we were not previously showing an error
            showingError = true;
        }
    }
    this.messageArea.updateText(message, messageType);
}
项目:Mailster    文件:ConfigurationDialog.java   
/**
 * Updates the title.
 * 
 * @see org.eclipse.jface.preference.IPreferencePageContainer#updateTitle()
 */
public void updateTitle()
{
    IPreferencePage currentPage = this.getCurrentPage();
    if (currentPage == null)
    {
        return;
    }
    this.messageArea.showTitle(currentPage.getTitle(), currentPage
            .getImage());
}
项目:external-filter    文件:EFToolsDynamicMenu.java   
static void showConfigDialog() {
    IWorkbenchWindow window = EFActivator.getDefault().getWorkbench().getActiveWorkbenchWindow();
    IPreferencePage page = new EFPreferencePage();
    PreferenceManager mgr = window.getWorkbench().getPreferenceManager();

    Shell shell = EFActivator.getDefault().getWorkbench().getDisplay().getActiveShell();
    PreferenceDialog dialog = new PreferenceDialog(shell, mgr);
    dialog.setSelectedNode("Externalfilter.preferences.ExternalFilterPreferencePage");
    dialog.create();
    dialog.setMessage(page.getTitle());
    dialog.open();
}
项目:elexis-3-base    文件:FileCommPartnerComposite.java   
public FileCommPartnerComposite(IPreferencePage preferencePage,
    ScrolledComposite scrolledComposite, Composite editorParent,
    FileCommPartner fileCommPartner){
    super(editorParent, SWT.BORDER);
    this.preferencePage = preferencePage;
    this.fileCommPartner = fileCommPartner;
    createElements();
    this.scrolledComposite = scrolledComposite;
    refreshParent(getParent());
}
项目:e4-cookbook-migration-guide    文件:PreferenceNodeContribution.java   
public PreferenceNodeContribution(String id, String label, Class<? extends IPreferencePage> pageClass) {
    this(id, label, null, pageClass, null, null);
}
项目:e4-cookbook-migration-guide    文件:PreferenceNodeContribution.java   
public PreferenceNodeContribution(String id, String label, Class<? extends IPreferencePage> pageClass, String path) {
    this(id, label, null, pageClass, path, null);
}
项目:e4-cookbook-migration-guide    文件:PreferenceNodeContribution.java   
public PreferenceNodeContribution(String id, String label, Class<? extends IPreferencePage> pageClass, String path, String nodeQualifier) {
    this(id, label, null, pageClass, path, nodeQualifier);
}
项目:e4-cookbook-migration-guide    文件:PreferenceNodeContribution.java   
public void addPreferenceNode(String id, String label, Class<? extends IPreferencePage> pageClass) {
    addPreferenceNode(id, label, null, pageClass, null, null);
}
项目:e4-cookbook-migration-guide    文件:PreferenceNodeContribution.java   
public void addPreferenceNode(String id, String label, Class<? extends IPreferencePage> pageClass, String path) {
    addPreferenceNode(id, label, null, pageClass, path, null);
}
项目:e4-cookbook-migration-guide    文件:PreferenceNodeContribution.java   
public void addPreferenceNode(String id, String label, Class<? extends IPreferencePage> pageClass, String path, String nodeQualifier) {
    addPreferenceNode(id, label, null, pageClass, path, nodeQualifier);
}
项目:e4-preferences    文件:ContributedPreferenceNode.java   
/**
 * Create a new ContributedPreferenceNode.
 * 
 * @param id
 *            the node id
 * @param label
 *            the label used to display the node in the preference dialog's
 *            tree
 * @param imageDescriptor
 *            the image displayed left of the label in the preference
 *            dialog's tree, or null if none
 * @param pageClass
 *            the preference page implementation, this class must implement
 *            {@link IPreferencePage}
 * @param path
 *            the path of the node to which the contributed node should be
 *            added to
 * @param nodeQualifier
 *            the qualifier used to look up the preference node
 */
public ContributedPreferenceNode(
        String id, 
        String label, 
        ImageDescriptor imageDescriptor,
        Class<? extends IPreferencePage> pageClass, 
        String path, 
        String nodeQualifier) {

    super(id, label, imageDescriptor, pageClass.getName());
    this.path = path;
    this.pageClass = pageClass;

    this.nodeQualifier = (nodeQualifier != null) 
            ? nodeQualifier : FrameworkUtil.getBundle(pageClass).getSymbolicName();

    this.context = EclipseContextFactory.getServiceContext(
            FrameworkUtil.getBundle(pageClass).getBundleContext());
    this.logger = context.get(LogService.class);
}
项目:e4-preferences    文件:PreferenceNodeContribution.java   
/**
 * Creates a {@link PreferenceNodeContribution} with the given settings.
 * 
 * @param id
 *            the node id
 * @param label
 *            the label used to display the node in the preference dialog's
 *            tree
 * @param imageDescriptor
 *            the image displayed left of the label in the preference
 *            dialog's tree, or null if none
 * @param pageClass
 *            the preference page implementation, this class must implement
 *            {@link IPreferencePage}
 * @param path
 *            the path of the node to which the contributed node should be
 *            added to
 * @param nodeQualifier
 *            the qualifier used to look up the preference node
 */
public PreferenceNodeContribution(
        String id, 
        String label, 
        ImageDescriptor imageDescriptor,
        Class<? extends IPreferencePage> pageClass, 
        String path,
        String nodeQualifier) {

    this.nodes.add(new ContributedPreferenceNode(
            id, 
            label, 
            imageDescriptor, 
            pageClass, 
            path, 
            nodeQualifier));
}
项目:e4-preferences    文件:PreferenceNodeContribution.java   
/**
 * Adds a {@link PreferenceNodeContribution} with the given settings.
 * 
 * @param id
 *            the node id
 * @param label
 *            the label used to display the node in the preference dialog's
 *            tree
 * @param imageDescriptor
 *            the image displayed left of the label in the preference
 *            dialog's tree, or null if none
 * @param pageClass
 *            the preference page implementation, this class must implement
 *            {@link IPreferencePage}
 * @param path
 *            the path of the node to which the contributed node should be
 *            added to
 * @param nodeQualifier
 *            the qualifier used to look up the preference node
 */
public void addPreferenceNode(
        String id, 
        String label, 
        ImageDescriptor imageDescriptor,
        Class<? extends IPreferencePage> pageClass, 
        String path,
        String nodeQualifier) {

    this.nodes.add(new ContributedPreferenceNode(
            id, 
            label, 
            imageDescriptor, 
            pageClass, 
            path, 
            nodeQualifier));
}
项目:birt    文件:StylePreferenceNode.java   
public StylePreferenceNode( String id, IPreferencePage preferencePage )
{
    super( id, preferencePage );
}
项目:Mailster    文件:ExtendedPreferenceNode.java   
/**
 * Creates the <code>PreferencePage</code> according to the settings in
 * this <code>ExtendedPreferenceNode</code>.
 */
public void createPage()
{
    setPage((IPreferencePage) this.createObject(this.classname));
    getPage().setTitle(this.getLabelText());
}
项目:e4-preferences    文件:PreferenceNodeContribution.java   
/**
 * Creates a {@link PreferenceNodeContribution} with the given settings.
 * Will set the imageDescriptor, the path and the nodeQualifier setting 
 * to <code>null</code>.
 * 
 * @param id
 *            the node id
 * @param label
 *            the label used to display the node in the preference dialog's
 *            tree
 * @param pageClass
 *            the preference page implementation, this class must implement
 *            {@link IPreferencePage}
 */
public PreferenceNodeContribution(
        String id, 
        String label, 
        Class<? extends IPreferencePage> pageClass) {
    this(id, label, null, pageClass, null, null);
}
项目:e4-preferences    文件:PreferenceNodeContribution.java   
/**
 * Creates a {@link PreferenceNodeContribution} with the given settings.
 * Will set the imageDescriptor and the nodeQualifier setting to
 * <code>null</code>.
 * 
 * @param id
 *            the node id
 * @param label
 *            the label used to display the node in the preference dialog's
 *            tree
 * @param pageClass
 *            the preference page implementation, this class must implement
 *            {@link IPreferencePage}
 * @param path
 *            the path of the node to which the contributed node should be
 *            added to
 */
public PreferenceNodeContribution(
        String id, 
        String label, 
        Class<? extends IPreferencePage> pageClass, 
        String path) {
    this(id, label, null, pageClass, path, null);
}
项目:e4-preferences    文件:PreferenceNodeContribution.java   
/**
 * Creates a {@link PreferenceNodeContribution} with the given settings.
 * Will set the imageDescriptor setting to <code>null</code>.
 * 
 * @param id
 *            the node id
 * @param label
 *            the label used to display the node in the preference dialog's
 *            tree
 * @param pageClass
 *            the preference page implementation, this class must implement
 *            {@link IPreferencePage}
 * @param path
 *            the path of the node to which the contributed node should be
 *            added to
 * @param nodeQualifier
 *            the qualifier used to look up the preference node
 */
public PreferenceNodeContribution(
        String id, 
        String label, 
        Class<? extends IPreferencePage> pageClass, 
        String path, 
        String nodeQualifier) {
    this(id, label, null, pageClass, path, nodeQualifier);
}
项目:e4-preferences    文件:PreferenceNodeContribution.java   
/**
 * Adds a {@link PreferenceNodeContribution} with the given settings.
 * Will set the imageDescriptor, the path and the nodeQualifier setting 
 * to <code>null</code>.
 * 
 * @param id
 *            the node id
 * @param label
 *            the label used to display the node in the preference dialog's
 *            tree
 * @param pageClass
 *            the preference page implementation, this class must implement
 *            {@link IPreferencePage}
 */
public void addPreferenceNode(
        String id, 
        String label, 
        Class<? extends IPreferencePage> pageClass) {
    addPreferenceNode(id, label, null, pageClass, null, null);
}
项目:e4-preferences    文件:PreferenceNodeContribution.java   
/**
 * Adds a {@link PreferenceNodeContribution} with the given settings. Will
 * set the imageDescriptor and the nodeQualifier setting to
 * <code>null</code>.
 * 
 * @param id
 *            the node id
 * @param label
 *            the label used to display the node in the preference dialog's
 *            tree
 * @param pageClass
 *            the preference page implementation, this class must implement
 *            {@link IPreferencePage}
 * @param path
 *            the path of the node to which the contributed node should be
 *            added to
 */
public void addPreferenceNode(
        String id, 
        String label, 
        Class<? extends IPreferencePage> pageClass, 
        String path) {
    addPreferenceNode(id, label, null, pageClass, path, null);
}
项目:e4-preferences    文件:PreferenceNodeContribution.java   
/**
 * Adds a {@link PreferenceNodeContribution} with the given settings.
 * Will set the imageDescriptor setting to <code>null</code>.
 * 
 * @param id
 *            the node id
 * @param label
 *            the label used to display the node in the preference dialog's
 *            tree
 * @param pageClass
 *            the preference page implementation, this class must implement
 *            {@link IPreferencePage}
 * @param path
 *            the path of the node to which the contributed node should be
 *            added to
 * @param nodeQualifier
 *            the qualifier used to look up the preference node
 */
public void addPreferenceNode(
        String id, 
        String label, 
        Class<? extends IPreferencePage> pageClass, 
        String path, 
        String nodeQualifier) {
    addPreferenceNode(id, label, null, pageClass, path, nodeQualifier);
}
项目:Mailster    文件:ExtendedPreferenceNode.java   
/**
 * Creates an <code>ExtendedPreferenceNode</code> with the given id and
 * preference page. The title of the preference page is used for the node
 * label. The node will not have an image.
 * 
 * @param id the node id
 * @param preferencePage the preference page
 */
public ExtendedPreferenceNode(String id, IPreferencePage preferencePage)
{
    super(id, preferencePage);
}