Example usage for org.eclipse.jface.preference IPreferencePage setImageDescriptor

List of usage examples for org.eclipse.jface.preference IPreferencePage setImageDescriptor

Introduction

In this page you can find the example usage for org.eclipse.jface.preference IPreferencePage setImageDescriptor.

Prototype

void setImageDescriptor(ImageDescriptor image);

Source Link

Document

Sets this dialog page's image.

Usage

From source file:at.spardat.xma.guidesign.preferences.AbstractPreferenceAndPropertyPage.java

License:Open Source License

/**
 * Creates a new preferences page and opens it
 * /*  w  w  w  . j a v a 2 s.c o m*/
 * @see com.bdaum.SpellChecker.preferences.SpellCheckerPreferencePage#configureWorkspaceSettings()
 */
protected void configureWorkspaceSettings() {
    try {
        // create a new instance of the current class
        IPreferencePage page = (IPreferencePage) this.getClass().newInstance();
        page.setTitle(getTitle());
        page.setImageDescriptor(image);
        // and show it
        showPreferencePage(getPageId(), page);
    } catch (InstantiationException e) {
        e.printStackTrace();
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    }
}

From source file:com.bdaum.overlayPages.FieldEditorOverlayPage.java

License:Open Source License

/**
 * Creates a new preferences page and opens it
 * /* w  ww  . j  a  va  2 s  .c  om*/
 * @see com.bdaum.SpellChecker.preferences.SpellCheckerPreferencePage#configureWorkspaceSettings()
 */
protected void configureWorkspaceSettings() {
    try {
        // create a new instance of the current class
        final IPreferencePage page = this.getClass().newInstance();
        page.setTitle(getTitle());
        page.setImageDescriptor(image);
        // and show it
        showPreferencePage(pageId, page);
    } catch (final InstantiationException e) {
        ErlLogger.warn(e);
    } catch (final IllegalAccessException e) {
        ErlLogger.warn(e);
    }
}

From source file:com.googlecode.cppcheclipse.ui.preferences.FieldEditorOverlayPage.java

License:Open Source License

/**
 * Creates a new preferences page and opens it
 *///from   www .  j  a va2s .c  o m
protected void configureWorkspaceSettings() {
    try {
        // create a new instance of the current class
        IPreferencePage page = (IPreferencePage) this.getClass().newInstance();
        page.setTitle(getTitle());
        page.setImageDescriptor(image);
        // and show it
        showPreferencePage(pageId, page);
    } catch (InstantiationException e) {
        CppcheclipsePlugin.logError("Error opening workspace settings", e);
    } catch (IllegalAccessException e) {
        CppcheclipsePlugin.logError("Error opening workspace settings", e);
    }
}

From source file:eu.scasefp7.eclipse.core.ui.preferences.FieldEditorOverlayPage.java

License:Open Source License

/**
 * Creates a new preferences page and opens it
 *//*from   w ww.j a  v  a  2  s .  c  o m*/
protected void configureWorkspaceSettings() {
    try {
        // create a new instance of the current class
        IPreferencePage page = (IPreferencePage) this.getClass().newInstance();
        page.setTitle(getTitle());
        page.setImageDescriptor(image);
        // and show it
        showPreferencePage(pageId, page);
    } catch (InstantiationException | IllegalAccessException e) {
        Activator.log("Unable to show preference page.", e);
    }
}

From source file:kieker.develop.rl.ui.preferences.TargetsPropertyPage.java

License:Apache License

/**
 * Creates and initializes a selection group with two choice buttons and one push button.
 * @param parent - the parent composite/*from   ww  w.jav a2s . c  o m*/
 */
private void createSelectionGroup(final Composite parent) {
    final Composite comp = new Composite(parent, SWT.NONE);
    final GridLayout layout = new GridLayout(2, false);
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    comp.setLayout(layout);
    comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    final Composite radioGroup = new Composite(comp, SWT.NONE);
    radioGroup.setLayout(new GridLayout());
    radioGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    this.useWorkspaceSettingsButton = this.createRadioButton(radioGroup, "Use &workspace settings");
    this.useProjectSettingsButton = this.createRadioButton(radioGroup, "Use pr&oject settings");
    this.configureButton = new Button(comp, SWT.PUSH);
    this.configureButton.setText("&Configure Workspace Settings ...");
    this.configureButton.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(final SelectionEvent event) {
            try {
                // create a new instance of the current class
                final IPreferencePage page = TargetsPropertyPage.this.getClass().newInstance();
                page.setTitle(TargetsPropertyPage.this.getTitle());
                page.setImageDescriptor(TargetsPropertyPage.this.imageDescriptor);
                // and show it
                TargetsPropertyPage.this.showPreferencePage(TargetsPropertyPage.PAGE_ID,
                        TargetsPropertyPage.this);
            } catch (final InstantiationException exception) {
                exception.printStackTrace();
            } catch (final IllegalAccessException exception) {
                exception.printStackTrace();
            }
        }
    });

    // Set workspace/project radio buttons
    try {
        final String use = this.getResource()
                .getPersistentProperty(new QualifiedName(PAGE_ID, USEPROJECTSETTINGS));
        if (TRUE.equals(use)) {
            this.useProjectSettingsButton.setSelection(true);
            this.configureButton.setEnabled(false);
        } else {
            this.useWorkspaceSettingsButton.setSelection(true);
        }
    } catch (final CoreException e) {
        this.useWorkspaceSettingsButton.setSelection(true);
    }
}

From source file:org.codehaus.groovy.eclipse.preferences.FieldEditorOverlayPage.java

License:Apache License

/**
 * Creates a new preferences page and opens it
 * //from w w  w . j  av a 2s.c  o m
 * @see com.bdaum.SpellChecker.preferences.SpellCheckerPreferencePage#configureWorkspaceSettings()
 */
protected void configureWorkspaceSettings() {
    try {
        // create a new instance of the current class
        final IPreferencePage page = this.getClass().newInstance();
        page.setTitle(getTitle());
        page.setImageDescriptor(image);
        // and show it
        showPreferencePage(pageID, page);
    } catch (final InstantiationException e) {
        e.printStackTrace();
    } catch (final IllegalAccessException e) {
        e.printStackTrace();
    }
}

From source file:org.eclipse.cdt.codan.internal.ui.preferences.FieldEditorOverlayPage.java

License:Open Source License

/**
 * Creates a new preferences page and opens it
 *///from  ww  w  .jav a2  s .c  o m
@SuppressWarnings("cast")
protected void configureWorkspaceSettings() {
    try {
        // create a new instance of the current class
        IPreferencePage page = (IPreferencePage) this.getClass().newInstance();
        page.setTitle(getTitle());
        page.setImageDescriptor(image);
        // and show it
        showPreferencePage(pageId, page);
    } catch (InstantiationException e) {
        CodanUIActivator.log(e);
    } catch (IllegalAccessException e) {
        CodanUIActivator.log(e);
    }
}

From source file:org.eclipse.titan.executor.properties.FieldEditorPropertyPage.java

License:Open Source License

protected void configureWorkspaceSettings() {
    try {//from w ww  .  ja va  2  s . c o  m
        IPreferencePage page = this.getClass().newInstance();
        page.setTitle(getTitle());
        page.setImageDescriptor(image);
        showPreferencePage(pageId, page);
    } catch (InstantiationException e) {
        ErrorReporter.logExceptionStackTrace(e);
    } catch (IllegalAccessException e) {
        ErrorReporter.logExceptionStackTrace(e);
    }
}

From source file:org.entirej.framework.plugin.preferences.FieldEditorOverlayPage.java

License:Apache License

/**
 * Creates a new preferences page and opens it
 *//*from   www . j  a  va2  s.com*/
protected void configureWorkspaceSettings() {
    try {
        // create a new instance of the current class
        IPreferencePage page = (IPreferencePage) this.getClass().newInstance();
        page.setTitle(getTitle());
        page.setImageDescriptor(image);
        // and show it
        showPreferencePage(pageId, page);
    } catch (InstantiationException e) {
        e.printStackTrace();
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    }
}

From source file:org.gradle.eclipse.preferences.FieldEditorOverlayPage.java

License:Apache License

protected void configureWorkspaceSettings() {
    try {//from  w  w w  .  j av a  2 s .  c  o  m
        IPreferencePage page = (IPreferencePage) this.getClass().newInstance();
        page.setTitle(getTitle());
        page.setImageDescriptor(image);
        showPreferencePage(pageId, page);
    } catch (InstantiationException e) {
        e.printStackTrace();
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    }
}