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

项目:APICloud-Studio    文件:OpenThemePreferencesHandler.java   
public Object execute(ExecutionEvent event) throws ExecutionException
{
    UIJob job = new UIJob("Open Theme Preferences") //$NON-NLS-1$
    {

        @Override
        public IStatus runInUIThread(IProgressMonitor monitor)
        {
            final PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(UIUtils.getActiveShell(),
                    ThemePreferencePage.ID, null, null);
            dialog.open();
            return Status.OK_STATUS;
        }
    };
    job.setPriority(Job.INTERACTIVE);
    job.setRule(PopupSchedulingRule.INSTANCE);
    job.schedule();
    return null;
}
项目:bts    文件:E4PreferencesHandler.java   
@Execute
    public void execute(@Named(IServiceConstants.ACTIVE_SHELL) Shell shell,  E4PreferenceRegistry prefReg, 
            @Optional @Named("preferencePageId") String pageId)
    {
        PreferenceManager pm = prefReg.getPreferenceManager();
        PreferenceDialog dialog = new PreferenceDialog(shell, pm);
        if (pageId != null)
        {
            dialog.setSelectedNode(pageId);
        }

        dialog.create();
        dialog.getTreeViewer().setComparator(new ViewerComparator());
//      dialog.getTreeViewer().expandAll();
        dialog.open();

    }
项目: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();
        }
    });
}
项目:statecharts    文件:MessageArea.java   
protected void createControls() {
    group = new Group(this, SWT.NONE);
    group.setLayout(new GridLayout(3, false));
    imageLabel = new Label(group, SWT.NONE);
    GridDataFactory.fillDefaults().grab(false, false).align(SWT.BEGINNING, SWT.CENTER).applyTo(imageLabel);
    textLabel = new Link(group, SWT.WRAP);
    textLabel.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            if (DOWNLOAD_LINK.equals(e.text)) {
                Program.launch(DOWNLOAD_LINK);
            } else {
                PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(getShell(), PREF_PAGE_ID,
                        new String[] { DISPLAY_ID }, null);
                dialog.setSelectedNode("DISPLAY_ID");
                dialog.open();
            }
        }
    });
    GridDataFactory.fillDefaults().grab(true, false).align(SWT.CENTER, SWT.CENTER).applyTo(textLabel);
    button = new Button(group, SWT.FLAT);
    button.setText("Download");
    GridDataFactory.fillDefaults().grab(false, false).align(SWT.END, SWT.CENTER).applyTo(button);
}
项目:datahierarchy    文件:AddToFilterAction.java   
@Override
    public void run(IAction action) {
        List<String> typesToFilter = getTypesToFilter(selection2);

        String preferencePageId = "DataHierarchy.globalPrefPage";
        String types = DataHierarchyPlugin.getDefault().getPreferenceStore().getString(
                IPrefConstants.PREF_ACTIVE_FILTERS_LIST);
        PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(null, preferencePageId,
                null, typesToFilter);
        int open = dialog.open();
        if (open != Window.OK) {
            return;
        }
        String newTypes = DataHierarchyPlugin.getDefault().getPreferenceStore().getString(
                IPrefConstants.PREF_ACTIVE_FILTERS_LIST);
        if (types.equals(newTypes)) {
            return;
        }
        part.updateFilter(newTypes);
//        SearchAgainAction search = new SearchAgainAction();
//        search.init(part);
//        search.run(action);
    }
项目:brainfuck    文件:ActiveHelpOpenPreferencePageAction.java   
@Override
public void run() {
    if (link == null) {
        return;
    }
    Display.getDefault().syncExec(new Runnable() {
        @Override
        public void run() {
            IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
            if (window != null) {
                 Shell shell = window.getShell();
                    shell.setMinimized(false);
                    shell.forceActive();
                    PreferenceDialog prefsDialog = PreferencesUtil.createPreferenceDialogOn(shell, link, null, additionalData);
                     prefsDialog.open();
            }
        }
    });
}
项目: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();
        }
    });
}
项目:APICloud-Studio    文件:ShowFilteredPreferencePageHandler.java   
public final Object execute(final ExecutionEvent event)
{
    final String preferencePageId = event.getParameter(IWorkbenchCommandConstants.WINDOW_PREFERENCES_PARM_PAGEID);
    final IWorkbenchWindow activeWorkbenchWindow = HandlerUtil.getActiveWorkbenchWindow(event);

    final Shell shell;
    if (activeWorkbenchWindow == null)
    {
        shell = null;
    }
    else
    {
        shell = activeWorkbenchWindow.getShell();
    }

    final PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(shell, preferencePageId,
            new String[] { preferencePageId }, null);
    dialog.open();

    return null;
}
项目: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();
        }
    });
}
项目:OpenSPIFe    文件:TableEditorPreferencePageHandler.java   
@Override
public final Object execute(final ExecutionEvent event) {
    final IWorkbenchWindow activeWorkbenchWindow = HandlerUtil.getActiveWorkbenchWindow(event);

    final Shell shell;
    if (activeWorkbenchWindow == null) {
        shell = null;
    } else {
        shell = activeWorkbenchWindow.getShell();
    }

    final PreferenceDialog prefDialog = PreferencesUtil.createPreferenceDialogOn(shell, MergeEditorPreferencePage.PAGE_ID, null, null);
    if (prefDialog != null)
        prefDialog.open();

    return null;
}
项目:OpenSPIFe    文件:DaysEditorPreferencePageHandler.java   
@Override
public final Object execute(final ExecutionEvent event) {
    final IWorkbenchWindow activeWorkbenchWindow = HandlerUtil.getActiveWorkbenchWindow(event);

    final Shell shell;
    if (activeWorkbenchWindow == null) {
        shell = null;
    } else {
        shell = activeWorkbenchWindow.getShell();
    }

    final PreferenceDialog prefDialog = PreferencesUtil.createPreferenceDialogOn(shell, DaysEditorPreferencePage.PAGE_ID, null, null);
    if (prefDialog != null)
        prefDialog.open();

    return null;
}
项目:JettyWTPPlugin    文件:JettyRuntimeComposite.java   
protected boolean showPreferencePage()
{
    Trace.trace(Trace.CONFIG, "JettyRuntimeComposite: showPreferencePage()");

    String id = "org.eclipse.jdt.debug.ui.preferences.VMPreferencePage";

    // should be using the following API, but it only allows a single
    // preference page instance.
    // see bug 168211 for details
    // PreferenceDialog dialog =
    // PreferencesUtil.createPreferenceDialogOn(getShell(), id, new String[]
    // { id }, null);
    // return (dialog.open() == Window.OK);

    PreferenceManager manager = PlatformUI.getWorkbench().getPreferenceManager();
    IPreferenceNode node = manager.find("org.eclipse.jdt.ui.preferences.JavaBasePreferencePage").findSubNode(id);
    PreferenceManager manager2 = new PreferenceManager();
    manager2.addToRoot(node);
    PreferenceDialog dialog = new PreferenceDialog(getShell(),manager2);
    dialog.create();
    return (dialog.open() == Window.OK);
}
项目:goclipse    文件:GoUIPlugin.java   
protected void checkPrefPageIdIsValid(String prefId) {
    Shell shell = WorkbenchUtils.getActiveWorkbenchShell();
    PreferenceDialog prefDialog = PreferencesUtil.createPreferenceDialogOn(shell, prefId, null, null);
    assertNotNull(prefDialog); // Don't create, just eagerly check that it exits, that the ID is correct
    ISelection selection = prefDialog.getTreeViewer().getSelection();
    if(selection instanceof IStructuredSelection) {
        IStructuredSelection ss = (IStructuredSelection) selection;
        if(ss.getFirstElement() instanceof IPreferenceNode) {
            IPreferenceNode prefNode = (IPreferenceNode) ss.getFirstElement();
            if(prefNode.getId().equals(prefId)) {
                return; // Id exists
            }
        }
    }
    assertFail();
}
项目:n4js    文件:OpenExternalLibraryPreferencePageHandler.java   
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    Shell shell = HandlerUtil.getActiveShell(event);
    PreferenceDialog dialog = createPreferenceDialogOn(shell, ExternalLibraryPreferencePage.ID, FILTER_IDS, null);
    if (null != dialog) {
        dialog.open();
    }
    return null;
}
项目:scanning    文件:PropertiesDialog.java   
@Override
protected Control createDialogArea(Composite parent) {

    // create a composite with standard margins and spacing
    Composite composite = (Composite)super.createDialogArea(parent);
    composite.setLayout(new GridLayout(1, false));

    final CLabel warning = new CLabel(composite, SWT.LEFT);
    warning.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
    warning.setImage(Activator.imageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/error.png").createImage());
    warning.setText("Expert queue configuration parameters, please use with caution.");

    TableViewer viewer   = new TableViewer(composite, SWT.FULL_SELECTION | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL);
    viewer.setUseHashlookup(true);
    viewer.getTable().setHeaderVisible(true);
    viewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    createColumns(viewer);
    viewer.setContentProvider(createContentProvider());

    viewer.setInput(props);

    final Button adv = new Button(composite, SWT.PUSH);
    adv.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false));
    adv.setText("Advanced...");

    adv.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            PreferenceDialog pref = PreferencesUtil.createPreferenceDialogOn(getShell(), "org.dawnsci.commandserver.ui.activemqPage", null, null);
            if (pref != null) pref.open();
        }
    });

    return composite;
}
项目:workspacemechanic    文件:OpenPreferencesAction.java   
/**
 * Opens the preferences dialog.
 */
private void openPreferences() {
  Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
  PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(
      shell, pageId, null, null);
  dialog.open();

  // not sure if I have to do any cleanup. If so, the we probably want to:
  // dialog.blockOnOpen(true), then do the cleanup
}
项目:google-cloud-eclipse    文件:LocalAppEngineServerWizardFragment.java   
@Override
public void widgetDisposed(DisposeEvent event) {
  if (openPreferenceDialog) {
    // switch to Cloud SDK preferences panel
    event.display.asyncExec(new Runnable() {
      @Override
      public void run() {
        PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(
            null, CloudSdkPreferenceArea.PAGE_ID, null, null);
        dialog.open();
      }
   });   
  }
}
项目:bts    文件:ShowPreferenceDialogHandler.java   
@Execute
public void execute(MApplication app) {
    PreferenceManager pm = configurePreferences();
    PreferenceDialog dialog = new PreferenceDialog(shell, pm);
    dialog.setPreferenceStore(new ScopedPreferenceStore(
            InstanceScope.INSTANCE, "org.bbaw.bts.app"));
    dialog.create();
    dialog.getTreeViewer().setComparator(new ViewerComparator());
    dialog.getTreeViewer().expandAll();
    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();
        }
    });
}
项目:agui_eclipse_plugin    文件:AguiPlugin.java   
private void openAguiPrefs() {
    PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(
            getDisplay().getActiveShell(),
            AguiPreferencePage.PAGE_ID, //$NON-NLS-1$ preferencePageId
            null,  // displayedIds
            null); // data
    dialog.open();
}
项目:e4-cookbook-migration-guide    文件:PreferencesHandler.java   
@Execute
public void execute(Shell shell, @PrefMgr PreferenceManager manager) {
    PreferenceDialog dialog = new PreferenceDialog(shell, manager) {
        @Override
        protected TreeViewer createTreeViewer(Composite parent) {
            TreeViewer viewer = super.createTreeViewer(parent);

            viewer.setComparator(new ViewerComparator() {

                @Override
                public int category(Object element) {
                    // this ensures that the General preferences page is always on top
                    // while the other pages are ordered alphabetical
                    if (element instanceof ContributedPreferenceNode
                            && ("general".equals(((ContributedPreferenceNode) element).getId()))) {
                        return -1;
                    }
                    return 0;
                }

            });

            return viewer;
        }
    };

    dialog.open();
}
项目:gwt-eclipse-plugin    文件:ConfigureProjectSdkMarkerResolution.java   
public void run(final IMarker marker) {
  PreferenceDialog page = PreferencesUtil.createPropertyDialogOn(
      CorePlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell(),
      marker.getResource().getProject(), projectPropertyPageID,
      new String[] {projectPropertyPageID}, null);

  page.open();
}
项目:gwt-eclipse-plugin    文件:AbstractProjectPropertiesAction.java   
public void run(IAction action) {
  Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();

  if (resource != null && resource.getType() == IResource.PROJECT) {
    PreferenceDialog page = PreferencesUtil.createPropertyDialogOn(shell,
        resource, propertiesPageID, null, null);
    if (page != null) {
      page.open();
      return;
    }
  }

  CorePluginLog.logError("Could not create project properties dialog for resource "
      + resource.toString());
}
项目:gwt-eclipse-plugin    文件:BrowserMenuPopulator.java   
/**
 * Find a browser to open url
 */
private void findBrowser() {
  MessageDialog md = new MessageDialog(SWTUtilities.getShell(), "No browsers found", null, null, MessageDialog.ERROR,
      new String[] { "Ok" }, 0) {

    @Override
    protected Control createMessageArea(Composite parent) {
      super.createMessageArea(parent);
      Link link = new Link(parent, SWT.NONE);

      link.setText("There are no browsers defined, please add one (Right-click on URL -> "
          + "Open with -> Add a Browser, or <a href=\"#\">Window -> Preferences -> General -> Web Browser</a>).");
      link.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
          PreferenceDialog dialog = PreferencesUtil
              .createPreferenceDialogOn(Display.getCurrent().getActiveShell(),
                  "org.eclipse.ui.browser.preferencePage", new String[] { "org.eclipse.ui.browser.preferencePage" },
                  null);

          if (dialog != null) {
            dialog.open();
          }
        }
      });
      return parent;
    }
  };
  md.open();
}
项目: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();
        }
    });
}
项目:brainfuck    文件:BfEditor.java   
@Override
public void openViewPreferencesDialog() {
    PreferenceDialog dialog = 
            PreferencesUtil.createPreferenceDialogOn(
                    null, 
                    EditorConstants.PREF_PAGE_EDITOR_ID, 
                    new String[]{
                            EditorConstants.PREF_PAGE_EDITOR_ID, 
                            BfTemplatePreferencePage.ID, 
                            EditorConstants.PREF_PAGE_GENERAL_TEXT_EDITOR_ID}, 
                    null);
    dialog.open();
}
项目:brainfuck    文件:BfEditorPreferencePage.java   
@Override
public void widgetSelected(SelectionEvent e) {
    String linkText = e.text;
    String additionalInfo = null;
    if (linkText.contains("#")) {
        String[] parts = linkText.split("#");
        linkText = parts[0];
        additionalInfo = parts[1];
    }
    PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(getShell(), linkText, null, additionalInfo);
    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();
        }
    });
}
项目:PerformanceHat    文件:RequestExceptionHandler.java   
public boolean handle(final IProject project, final RequestException exception, final ErrorType... handledErrorTypes) {
  final ErrorType type = exception.getType();
  if (ImmutableList.copyOf(handledErrorTypes).contains(type)) {
    switch (type) {

      case FEEDBACK_HANDLER_NOT_AVAILABLE:
        new AbstractMessageDialog() {
          @Override
          public void action(final Shell shell) {
            final PreferenceDialog preferencePage = PreferencesUtil.createPreferenceDialogOn(shell, BaseIds.PREFERENCE_PAGE, null, null);
            if (preferencePage != null) {
              preferencePage.open();
            }
          }
        }.display(type.getTitle(), Messages.MESSAGE__FEEDBACK_HANDLER_NOT_AVAILABLE, MessageDialog.ERROR, Messages.OPEN_PREFERENCES);
        return true;

      case INVALID_APPLICATION_ID:
        openPropertyPage(project, BaseIds.PROPERTIES_PAGE__FDD_MAIN, type.getTitle(), Messages.MESSAGE__INVALID_APPLICATION_ID);
        return true;

      case WRONG_ACCESS_TOKEN:
        openPropertyPage(project, BaseIds.PROPERTIES_PAGE__FDD_MAIN, type.getTitle(), Messages.MESSAGE__WRONG_ACCESS_TOKEN);
        return true;

      default:
        break;
    }
  }
  Logger.print(exception.getMessage());
  return false;
}
项目:PerformanceHat    文件:RequestExceptionHandler.java   
private void openPropertyPage(final IProject project, final String propertyPageId, final String title, final String message) {
  new AbstractMessageDialog() {
    @Override
    public void action(final Shell shell) {
      final PreferenceDialog propertyDialog = PreferencesUtil.createPropertyDialogOn(shell, project, propertyPageId, null, null);
      if (propertyDialog != null) {
        propertyDialog.open();
      }
    }
  }.display(title, message, MessageDialog.ERROR, Messages.OPEN_PROPERTIES);
}
项目:vTM-eclipse    文件:ZXTMSettingsAction.java   
/**
 * Run the command, displaying a new project properties dialog on the ZXTM
 * settings page.
 */
/* Override */
public void run( ExecutionEvent event )
{
   ZXTM currentZXTM = zxtm;

   // No selection, check if the ZXTM Viewer has one currently.
   if( currentZXTM == null ) {
      ModelSelection currentSelection = ZXTMViewer.getSelectionForOpenViewer();
      if( currentSelection != null && currentSelection.isOnlyOneZXTM() ) {
         currentZXTM = currentSelection.firstZXTM();
      }
   }

   if( currentZXTM == null ) {
      return;
   }

   // Display the settings page.
   IProject project = ZXTMProject.getProjectForZXTM( currentZXTM );       
   PreferenceDialog dialog = PreferencesUtil.createPropertyDialogOn( 
      Display.getCurrent().getActiveShell(), project, Ids.RES_PREFS_ZXTM, 
      null, null 
   );

   dialog.open();
}
项目:ecle    文件:PrefsHandler.java   
/**
 * the command has been executed, so extract extract the needed information
 * from the application context.
 */
public Object execute(ExecutionEvent event) throws ExecutionException {
    IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
    PreferenceDialog pref = PreferencesUtil.createPreferenceDialogOn(window.getShell(), "org.ploys.ecle.prefs", null, null);
    if (pref != null)
        pref.open();        

    return null;
}
项目:txtUML    文件:PreferencesPageHandler.java   
/**
 * Opens the perferences page 
 */
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    PreferenceDialog pd = PreferencesUtil.createPreferenceDialogOn(null,
                            "hu.elte.txtuml.export.papyrus.preferences1", null, null);

    pd.open();
    return null;
}
项目:eclipse-filecompletion    文件:OpenFileInEclipseImpl.java   
public static void openFileInExternalProgram(File file) throws IOException {
    LOG.info("opening file : " + file);
    String programPathString = FileCompletionActivator.getDefault().getPreferenceStore()
            .getString(FileCompletionActivator.openFileWithExternalProgramCmdPerfId);
    if (programPathString == null || programPathString.trim().length() == 0) {
        LOG.info("opening pref dialog");
        PreferenceDialog createPreferenceDialogOn = PreferencesUtil.createPreferenceDialogOn(null,
                FileCompletionActivator.fileCompletionPref, null, null);
        createPreferenceDialogOn.open();
        LOG.info("finishing pref dialog");
        // user should try again after setting external program
        return;
    }
    LOG.info("programPathString = " + programPathString);
    File programFile = new File(programPathString);
    if (!programFile.isFile()) {
        throw new FileNotFoundException(programPathString);
    }
    ArrayList<String> cmd = new ArrayList<String>();
    cmd.add(programPathString);
    String args = FileCompletionActivator.getDefault().getPreferenceStore()
            .getString(FileCompletionActivator.openFileWithExternalProgramArgsPerfId);
    if (args != null && args.length() > 0) {
        cmd.addAll(Arrays.asList(args.split(" ")));
    }
    cmd.add(file.getAbsolutePath());
    LOG.info("command to run : " + cmd);
    String[] command = cmd.toArray(new String[0]);
    Runtime.getRuntime().exec(command);
}
项目:Eclipse-Postfix-Code-Completion    文件:NewTypeWizardPage.java   
private void typePageLinkActivated() {
    IJavaProject project= getJavaProject();
    if (project != null) {
        PreferenceDialog dialog= PreferencesUtil.createPropertyDialogOn(getShell(), project.getProject(), CodeTemplatePreferencePage.PROP_ID, null, null);
        dialog.open();
    } else {
        String title= NewWizardMessages.NewTypeWizardPage_configure_templates_title;
        String message= NewWizardMessages.NewTypeWizardPage_configure_templates_message;
        MessageDialog.openInformation(getShell(), title, message);
    }
}
项目:Eclipse-Postfix-Code-Completion    文件:SurroundWithTemplateMenuAction.java   
/**
 * {@inheritDoc}
 */
@Override
public void run() {
    PreferenceDialog preferenceDialog= PreferencesUtil.createPreferenceDialogOn(getShell(), JAVA_TEMPLATE_PREFERENCE_PAGE_ID, new String[] { JAVA_TEMPLATE_PREFERENCE_PAGE_ID, CODE_TEMPLATE_PREFERENCE_PAGE_ID }, null);
    preferenceDialog.getTreeViewer().expandAll();
    preferenceDialog.open();
}
项目:tesb-studio-se    文件:OpenRuntimePrefsAction.java   
@Override
public void run() {
    PreferenceDialog dlg = new PreferenceDialog(Display.getDefault().getActiveShell(), PlatformUI.getWorkbench()
            .getPreferenceManager());
    dlg.setSelectedNode(RunContainerPreferencePage.ID);
    dlg.open();

}
项目:emfstore-rest    文件:ProjectPropertiesHandler.java   
@Override
public void handle() {
    PreferenceDialog propertyDialog = PreferencesUtil.createPropertyDialogOn(getShell(),
        requireSelection(ProjectSpace.class).getProject(), null, null, null);
    if (propertyDialog != null) {
        propertyDialog.open();
    }
}
项目:gef-gwt    文件:JFaceResources.java   
/**
     * Initialize default images in JFace's image registry.
     * 
     */
    private static void initializeDefaultImages() {

        Object bundle = null;
//      try {
            // bundle = JFaceActivator.getBundle();
//      } catch (NoClassDefFoundError exception) {
//          // Test to see if OSGI is present
//      }
        declareImage(bundle, Wizard.DEFAULT_IMAGE, ICONS_PATH + "page.gif", //$NON-NLS-1$
                Wizard.class, "images/page.gif"); //$NON-NLS-1$

        // register default images for dialogs
        declareImage(bundle, Dialog.DLG_IMG_MESSAGE_INFO, ICONS_PATH
                + "message_info.gif", Dialog.class, "images/message_info.gif"); //$NON-NLS-1$ //$NON-NLS-2$
        declareImage(bundle, Dialog.DLG_IMG_MESSAGE_WARNING, ICONS_PATH
                + "message_warning.gif", Dialog.class, //$NON-NLS-1$
                "images/message_warning.gif"); //$NON-NLS-1$
        declareImage(bundle, Dialog.DLG_IMG_MESSAGE_ERROR, ICONS_PATH
                + "message_error.gif", Dialog.class, "images/message_error.gif");//$NON-NLS-1$ //$NON-NLS-2$
        declareImage(bundle, Dialog.DLG_IMG_HELP,
                ICONS_PATH + "help.gif", Dialog.class, "images/help.gif");//$NON-NLS-1$ //$NON-NLS-2$
        declareImage(
                bundle,
                TitleAreaDialog.DLG_IMG_TITLE_BANNER,
                ICONS_PATH + "title_banner.png", TitleAreaDialog.class, "images/title_banner.gif");//$NON-NLS-1$ //$NON-NLS-2$
        declareImage(
                bundle,
                PreferenceDialog.PREF_DLG_TITLE_IMG,
                ICONS_PATH + "pref_dialog_title.gif", PreferenceDialog.class, "images/pref_dialog_title.gif");//$NON-NLS-1$ //$NON-NLS-2$
        declareImage(bundle, PopupDialog.POPUP_IMG_MENU, ICONS_PATH
                + "popup_menu.gif", PopupDialog.class, "images/popup_menu.gif");//$NON-NLS-1$ //$NON-NLS-2$
        declareImage(
                bundle,
                PopupDialog.POPUP_IMG_MENU_DISABLED,
                ICONS_PATH + "popup_menu_disabled.gif", PopupDialog.class, "images/popup_menu_disabled.gif");//$NON-NLS-1$ //$NON-NLS-2$
    }