コード例 #1
0
 @Override
 public boolean openPage(String pageId, Object data) {
   setPageData(data);
   setCurrentPageId(pageId);
   IPreferencePage page = getCurrentPage();
   if (page instanceof PreferencePage) {
     ((PreferencePage) page).applyData(data);
   }
   return true;
 }
 /* (non-Javadoc)
  * @see org.eclipse.jface.preference.PreferencePage#applyData(java.lang.Object)
  */
 @Override
 public void applyData(Object data) {
   if (data instanceof Map && fVariableBlock != null) {
     Object id = ((Map<?, ?>) data).get(DATA_SELECT_VARIABLE);
     if (id instanceof String) {
       fVariableBlock.setSelection((String) id);
     }
   }
   super.applyData(data);
 }
コード例 #3
0
  @Override
  protected void createPage(IPreferenceNode node) {

    super.createPage(node);
    if (this.pageData == null) {
      return;
    }
    // Apply the data if it has been set.
    IPreferencePage page = node.getPage();
    if (page instanceof PreferencePage) {
      ((PreferencePage) page).applyData(this.pageData);
    }
  }
コード例 #4
0
  /**
   * 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);
    }
  }