/** * @param element must be an instance of <code>IPreferenceNode</code>. * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object) */ public String getText(Object element) { return ((IPreferenceNode) element).getLabelText(); }
@Override public String getLabel() { return preferenceNode.getLabelText(); }
/** * @param element must be an instance of <code>IPreferenceNode</code>. * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object) */ @Override public String getText(Object element) { return ((IPreferenceNode) element).getLabelText(); }
/** * @param element must be an instance of <code>IPreferenceNode</code>. * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object) */ @Override public String getText(Object element) { return ((IPreferenceNode) element).getLabelText(); }
@Override public String getLabel() { if (prefix != null && prefix.length() > 0) { return preferenceNode.getLabelText() + separator + prefix; } return preferenceNode.getLabelText(); }
/** * Tries to extract a useful string for comparison from the provided object. * This method is a workaround for bug 226547. Looking forward we need a * more sensible answer to this problem. * * @param o * the object to test * @return the comparison string * TODO : remove this method and replace it with a sensible solution */ private String getComparisonString(Object o) { if (o instanceof IPreferenceNode) { return ((IPreferenceNode)o).getLabelText(); } return o.toString(); }
private static String getLinkLabel(String pageId, String message) { IPreferenceNode node = getPreferenceNode(pageId); if (node == null) { return NLS.bind(TeamUIMessages.NotFound, pageId); } else { return MessageFormat.format(message, node.getLabelText()); } }
private void collectElements(String prefix, IPreferenceNode[] subNodes, List<PreferenceElement> result) { for (int i = 0; i < subNodes.length; i++) { if (!WorkbenchActivityHelper.filterItem(subNodes[i])) { PreferenceElement preferenceElement = new PreferenceElement(subNodes[i], prefix, this); result.add(preferenceElement); String nestedPrefix = prefix.length() == 0 ? subNodes[i].getLabelText() : (prefix + "/" + subNodes[i].getLabelText()); //$NON-NLS-1$ collectElements(nestedPrefix, subNodes[i].getSubNodes(), result); } } }
/** * Iterate through the preference page and build the map of preference page * names to ids. * * @param values * The Map being populated with parameter values. * @param preferenceNodes * An array of <code>IPreferenceNode</code> to process. * @param namePrefix * A string incorporating the names of each parent * <code>IPreferenceNode</code> up to the root of the * preference page tree. This will be <code>null</code> for the * root level preference page nodes. */ private void collectParameterValues(final Map values, final IPreferenceNode[] preferenceNodes, final String namePrefix) { for (final IPreferenceNode preferenceNode : preferenceNodes) { final String name; if (namePrefix == null) { name = preferenceNode.getLabelText(); } else { name = namePrefix + WorkbenchMessages.PreferencePageParameterValues_pageLabelSeparator + preferenceNode.getLabelText(); } final String value = preferenceNode.getId(); values.put(name, value); collectParameterValues(values, preferenceNode.getSubNodes(), name); } }
public void run() { dialog.create(); dialog.setMessage(targetNode.getLabelText()); result[0]= (dialog.open() == Window.OK); } });
public void run() { dialog.create(); dialog.setMessage(targetNode.getLabelText()); dialog.open(); } });
@Override protected boolean isLeafMatch(Viewer viewer, Object element) { IPreferenceNode node = (IPreferenceNode) element; String text = node.getLabelText(); if (wordMatches(text)) { return true; } // Also need to check the keywords for (String keyword : getKeywords(node)) { if (wordMatches(keyword)) { return true; } } return false; }
@Override protected boolean showPage(IPreferenceNode node) { final boolean success = super.showPage(node); if (success) { history.addHistoryEntry(new PreferenceHistoryEntry(node.getId(), node.getLabelText(), null)); } return success; }
private boolean showPreferencePage(final IPreferenceNode targetNode, Shell shell) { PreferenceManager manager = new PreferenceManager(); manager.addToRoot(targetNode); final PreferenceDialog dialog = new PreferenceDialog(shell, manager); final boolean[] result = new boolean[] {false}; BusyIndicator.showWhile(shell.getDisplay(), () -> { dialog.create(); dialog.setMessage(targetNode.getLabelText()); if (dialog.open() == Window.OK) result[0] = true; }); return result[0]; }
WorkbenchMessages.PreferenceNode_NotFound, pageId); } else { result = MessageFormat.format(message, node.getLabelText());
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(DebugUIPlugin.getShell(), manager); final boolean [] result = new boolean[] { false }; BusyIndicator.showWhile(DebugUIPlugin.getStandardDisplay(), () -> { dialog.create(); dialog.setMessage(targetNode.getLabelText()); result[0] = (dialog.open() == Window.OK); }); }
@Override public void run() { final IPreferenceNode targetNode = new TargetPlatformPreferenceNode(); PreferenceManager manager = new PreferenceManager(); manager.addToRoot(targetNode); Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); final PreferenceDialog dialog = new PreferenceDialog(shell, manager); BusyIndicator.showWhile(Display.getCurrent(), () -> { dialog.create(); dialog.setMessage(targetNode.getLabelText()); dialog.open(); }); }
/** * Shows the string variables preference page and returns <code>true</code> if OK was pressed. * * @return whether OK was pressed */ private boolean showVariablesPage() { StringVariablePreferencePage page = new StringVariablePreferencePage(); page.setTitle(StringSubstitutionMessages.StringVariableSelectionDialog_1); final IPreferenceNode targetNode = new PreferenceNode("org.eclipse.debug.ui.StringVariablePreferencePage", page); //$NON-NLS-1$ PreferenceManager manager = new PreferenceManager(); manager.addToRoot(targetNode); final PreferenceDialog dialog = new PreferenceDialog(DebugUIPlugin.getShell(), manager); final boolean [] result = new boolean[] { false }; BusyIndicator.showWhile(DebugUIPlugin.getStandardDisplay(), () -> { dialog.create(); dialog.setMessage(targetNode.getLabelText()); result[0] = (dialog.open() == Window.OK); }); return result[0]; }