Esempio n. 1
0
  /** @return either Window.OK or Window.CANCEL */
  private int showPreferenceDialog() {
    FilteredPreferenceDialog dialog =
        WorkbenchPreferenceDialog.createDialogOn(window.getShell(), DebugPreferencePage.PAGE_ID);

    dialog.showOnly(new String[] {DebugPreferencePage.PAGE_ID});

    return dialog.open();
  }
  /**
   * Apply the data to the first page if there is any.
   *
   * @param data The data to be applied
   * @param displayedIds The ids to filter to.
   * @param dialog The dialog to apply to.
   */
  private static void applyOptions(
      Object data, String[] displayedIds, FilteredPreferenceDialog dialog) {
    if (data != null) {
      dialog.setPageData(data);
      IPreferencePage page = dialog.getCurrentPage();
      if (page instanceof PreferencePage) {
        ((PreferencePage) page).applyData(data);
      }
    }

    if (displayedIds != null) {
      dialog.showOnly(displayedIds);
    }
  }