Package org.eclipse.jface.preference

Examples of org.eclipse.jface.preference.IPreferenceNode


    public PreferenceLinkArea(Composite parent, int style, final String pageId,
            String message, final IWorkbenchPreferenceContainer pageContainer,
            final Object pageData) {
        pageLink = new Link(parent, style);

        IPreferenceNode node = getPreferenceNode(pageId);
        String result;
        if (node == null) {
      result = NLS.bind(
                    WorkbenchMessages.PreferenceNode_NotFound, pageId);
    } else {
            result = MessageFormat.format(message, new String[] { node
                    .getLabelText() });
           
            //Only add the selection listener if the node is found
            pageLink.addSelectionListener(new SelectionAdapter() {
                /*
 
View Full Code Here


     */
    private IPreferenceNode getPreferenceNode(String pageId) {
        Iterator iterator = PlatformUI.getWorkbench().getPreferenceManager()
                .getElements(PreferenceManager.PRE_ORDER).iterator();
        while (iterator.hasNext()) {
            IPreferenceNode next = (IPreferenceNode) iterator.next();
            if (next.getId().equals(pageId)) {
        return next;
      }
        }
        return null;
    }
View Full Code Here

        ISelection sel = new StructuredSelection(new AnnotationTypeNode(editor, null));
        PropertyPage page = new EditorAnnotationPropertyPage();
        page.setElement(new AnnotationTypeNode(editor, null));
        page.setTitle("Styles");
        PreferenceManager mgr = new PreferenceManager();
        IPreferenceNode node = new PreferenceNode("1", page);
        mgr.addToRoot(node);
        PropertyDialog dialog = new PropertyDialog(getSite().getShell(), mgr, sel);
        dialog.create();
        dialog.setMessage(page.getTitle());
        dialog.open();
View Full Code Here

        // createPreferenceDialogOn.open();

        IWorkbenchPropertyPage page = new WebDirectoryLocation();
        page.setElement(project);
        PreferenceManager mgr = new PreferenceManager();
        IPreferenceNode node = new PreferenceNode("1", page);

        mgr.addToRoot(node);
        PreferenceDialog dialog = new PreferenceDialog(Display
            .getDefault().getActiveShell(), mgr);
        dialog.create();
View Full Code Here

    /** Activate the action and pop up the Options dialog.
     *
     *  @param action The action proxy (not used in this method).
     */
    public void run(IAction action) {
        IPreferenceNode node = _window.getWorkbench().getPreferenceManager()
                .find(PreferenceConstants.PTII_PREFERENCE_ID);
        PreferenceManager manager = new PreferenceManager();
        manager.addToRoot(node);

        PreferenceDialog dialog = new PreferenceDialog(_window.getShell(),
View Full Code Here

   * <code>null</code> is returned.
   *
   * @see org.eclipse.jface.preference.PreferenceDialog#findNodeMatching(java.lang.String)
   */
  protected IPreferenceNode findNodeMatching(String nodeId) {
    IPreferenceNode node = super.findNodeMatching(nodeId);
    if (WorkbenchActivityHelper.filterItem(node)) {
      return null;
    }
    return node;
  }
View Full Code Here

   * <code>null</code> is returned.
   *
   * @see org.eclipse.jface.preference.PreferenceDialog#findNodeMatching(java.lang.String)
   */
  protected IPreferenceNode findNodeMatching(String nodeId) {
    IPreferenceNode node = super.findNodeMatching(nodeId);
    if (WorkbenchActivityHelper.filterItem(node)) {
      return null;
    }
    return node;
  }
View Full Code Here

   * @param preferencePageId
   *            The preference page identifier to select; should not be
   *            <code>null</code>.
   */
  public final void setCurrentPageId(final String preferencePageId) {
    final IPreferenceNode node = findNodeMatching(preferencePageId);
    if (node != null) {
      getTreeViewer().setSelection(new StructuredSelection(node));
      showPage(node);
    }
  }
View Full Code Here

      return true;
    }

    ITreeContentProvider contentProvider = (ITreeContentProvider) ((TreeViewer) viewer)
        .getContentProvider();
    IPreferenceNode node = (IPreferenceNode) element;
    Object[] children = contentProvider.getChildren(node);
    // Will return true if any subnode of the element matches the search
    if (filter(viewer, element, children).length > 0) {
      return true;
    }   
View Full Code Here

  /* (non-Javadoc)
   * @see org.eclipse.ui.dialogs.PatternFilter#isLeafMatch(org.eclipse.jface.viewers.Viewer, java.lang.Object)
   *
   */
  protected boolean isLeafMatch(Viewer viewer, Object element) {
    IPreferenceNode node = (IPreferenceNode) element;
    String text = node.getLabelText();

    if (wordMatches(text)) {
      return true;
    }

View Full Code Here

TOP

Related Classes of org.eclipse.jface.preference.IPreferenceNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.