Java PreferenceManager.remove方法代码示例

本文整理汇总了Java中org.eclipse.jface.preference.PreferenceManager.remove方法的典型用法代码示例。如果您正苦于以下问题:Java PreferenceManager.remove方法的具体用法?Java PreferenceManager.remove怎么用?Java PreferenceManager.remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jface.preference.PreferenceManager的用法示例。


Java PreferenceManager.remove方法代码示例

在下文中一共展示了PreferenceManager.remove方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: hidePreference

import org.eclipse.jface.preference.PreferenceManager; //导入方法依赖的package包/类
public static void hidePreference(String[] ids){
//    	List<String> list = Arrays.asList(ids);
        PreferenceManager preferenceManager = PlatformUI.getWorkbench().getPreferenceManager();
//        @SuppressWarnings("unchecked")
//        List<IPreferenceNode> preferenceNodes = preferenceManager.getElements(PreferenceManager.PRE_ORDER);
//        for (Iterator<IPreferenceNode> it = preferenceNodes.iterator(); it.hasNext();) {
//            IPreferenceNode preferenceNode = (IPreferenceNode)it.next();
//            if (list.contains(preferenceNode.getId())) {
//                preferenceManager.remove(preferenceNode);
//            }
//        }
        
        for(String id : ids){
        	preferenceManager.remove(id);
        }
        
    } 
开发者ID:scouter-project,项目名称:scouter,代码行数:18,代码来源:RCPUtil.java

示例2: cleanupPreferencePages

import org.eclipse.jface.preference.PreferenceManager; //导入方法依赖的package包/类
protected final void cleanupPreferencePages() {
	Collection<Pattern> patterns = new HashSet<Pattern>();
	for (String s : getUndesirablePreferencePageIDRegExes())
		patterns.add(Pattern.compile(s));
	if (patterns.size() == 0)
		return;
	PreferenceManager manager = PlatformUI.getWorkbench().getPreferenceManager();
	for (IPreferenceNode node : manager.getRootSubNodes()) {
		for (Pattern pattern : patterns) {
			if (pattern.matcher(node.getId()).matches()) {
				manager.remove(node);
				continue;
			}
		}
		cleanupPreferencePages(node, patterns);
	}
} 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:18,代码来源:EnsembleWorkbenchWindowAdvisor.java

示例3: postStartup

import org.eclipse.jface.preference.PreferenceManager; //导入方法依赖的package包/类
@Override
public void postStartup() {
    PreferenceManager pm = PlatformUI.getWorkbench().getPreferenceManager();
    pm.remove("org.eclipse.help.ui.browsersPreferencePage");
    pm.remove("org.eclipse.team.ui.TeamPreferences");
    pm.remove("org.csstudio.platform.ui.css.applications");
    pm.remove("org.csstudio.platform.ui.css.platform");
} 
开发者ID:yamcs,项目名称:yamcs-studio,代码行数:9,代码来源:YamcsStudioWorkbenchAdvisor.java

示例4: initialize

import org.eclipse.jface.preference.PreferenceManager; //导入方法依赖的package包/类
public void initialize()
{
    if (Activator.getDefault().getWorkbench() == null)
    {
        return;
    }
    PreferenceManager pm = Activator.getDefault().getWorkbench().getPreferenceManager();

    if (pm != null)
    {
        /*
         * Subpages need to be removed by calling the remove method
         * on their parent. Pages with no parent can be removed
         * by calling the remove method on the preference manager.
         * 
         * Getting the appropriate id of the page to remove can be done
         * using the code that is commented at the end of this method.
         * It will print out the name followed by the id of every preference page.
         */
        IPreferenceNode generalNode = pm.find("org.eclipse.ui.preferencePages.Workbench");
        if (generalNode != null)
        {
            // these are sub pages of general that we want removed
            generalNode.remove("org.eclipse.ui.preferencePages.Workspace");
            generalNode.remove("org.eclipse.ui.preferencePages.ContentTypes");
            // We no longer want to remove this node.
            // We only want to remove one of its sub nodes.
            // generalNode.remove("org.eclipse.ui.preferencePages.Views");
            // we only want to remove some subnodes of the Editors page
            IPreferenceNode editorsNode = generalNode.findSubNode("org.eclipse.ui.preferencePages.Editors");
            if (editorsNode != null)
            {
                // remove File Associations page
                editorsNode.remove("org.eclipse.ui.preferencePages.FileEditors");
                // want to remove only some subnodes of the Text Editors page
                IPreferenceNode textEditorsNode = editorsNode
                        .findSubNode("org.eclipse.ui.preferencePages.GeneralTextEditor");
                if (textEditorsNode != null)
                {
                    textEditorsNode.remove("org.eclipse.ui.editors.preferencePages.Spelling");
                    textEditorsNode.remove("org.eclipse.ui.editors.preferencePages.QuickDiff");
                    textEditorsNode.remove("org.eclipse.ui.editors.preferencePages.LinkedModePreferencePage");
                }
            }
            generalNode.remove("org.eclipse.ui.preferencePages.Perspectives");
            generalNode.remove("org.eclipse.equinox.security.ui.category");
            IPreferenceNode appearanceNode = generalNode.findSubNode("org.eclipse.ui.preferencePages.Views");
            if (appearanceNode != null)
            {
                // Removes the label decorators node that is a sub node of
                // the appearance node.
                // We want to keep the other sub node, colors and fonts
                // because it allows for setting the font for
                // the module editor.
                appearanceNode.remove("org.eclipse.ui.preferencePages.Decorators");
            }
        }

        // remove Install/Update
        pm.remove("org.eclipse.equinox.internal.p2.ui.sdk.ProvisioningPreferencePage");

        // remove the sub node of help
        IPreferenceNode helpNode = pm.find("org.eclipse.help.ui.browsersPreferencePage");
        if (helpNode != null)
        {
            helpNode.remove("org.eclipse.help.ui.contentPreferencePage");
        }
    }
} 
开发者ID:tlaplus,项目名称:tlaplus,代码行数:70,代码来源:UnwantedPreferenceManager.java

示例5: postWindowOpen

import org.eclipse.jface.preference.PreferenceManager; //导入方法依赖的package包/类
public void postWindowOpen() {
	final PreferenceManager preferenceManager = PlatformUI.getWorkbench().getPreferenceManager();
	final IPreferenceNode[] rootSubNodes = preferenceManager.getRootSubNodes();

	// @see Bug #191 in general/bugzilla/index.html
	final List<String> filters = new ArrayList<String>();
	filters.add("org.eclipse.compare");
	// The following three preferences are shown because the Toolbox uses
	// the local history feature provided by o.e.team.ui
	filters.add("org.eclipse.team.ui");
	filters.add("org.eclipse.ui.trace");
	filters.add("org.eclipse.jsch.ui");

	// Filter out Pdf4Eclipse preference page.
	filters.add("de.vonloesch.pdf4Eclipse");
	
	// Filter out GraphViz
	filters.add("com.abstratt.graphviz.ui");
	
	// Clean the preferences
	final List<IPreferenceNode> elements = preferenceManager.getElements(PreferenceManager.POST_ORDER);
	for (Iterator<IPreferenceNode> iterator = elements.iterator(); iterator.hasNext();) {
		final IPreferenceNode elem = iterator.next();
		if (elem instanceof IPluginContribution) {
			final IPluginContribution aPluginContribution = (IPluginContribution) elem;
			if (filters.contains(aPluginContribution.getPluginId())) {
				final IPreferenceNode node = (IPreferenceNode) elem;

				// remove from root node
				preferenceManager.remove(node);

				// remove from all subnodes
				for (int i = 0; i < rootSubNodes.length; i++) {
					final IPreferenceNode subNode = rootSubNodes[i];
					subNode.remove(node);
				}
			}
		}
	}
	super.postWindowOpen();
	
	// At this point in time we can be certain that the UI is fully
	// instantiated (views, editors, menus...). Thus, register
	// listeners that connect the UI to the workspace resources.
	ToolboxLifecycleParticipantManger.postWorkbenchWindowOpen();
} 
开发者ID:tlaplus,项目名称:tlaplus,代码行数:47,代码来源:ApplicationWorkbenchWindowAdvisor.java

示例6: openPreferenceDialog

import org.eclipse.jface.preference.PreferenceManager; //导入方法依赖的package包/类
public static void openPreferenceDialog(IWorkbenchWindow window, final String defaultId) {
	PreferenceManager mgr = window.getWorkbench().getPreferenceManager();
	mgr.remove("net.heartsome.cat.ui.preferencePages.Perspectives");
	mgr.remove("org.eclipse.ui.preferencePages.Workbench");
	mgr.remove("org.eclipse.update.internal.ui.preferences.MainPreferencePage");
	mgr.remove("org.eclipse.help.ui.browsersPreferencePage");
	final Object[] defaultNode = new Object[1];
	HsPreferenceDialog dlg = new HsPreferenceDialog(window.getShell(), mgr);
	dlg.create();

	final List<Image> imageList = new ArrayList<Image>();
	dlg.getTreeViewer().setLabelProvider(new PreferenceLabelProvider() {
		public Image getImage(Object element) {
			String id = ((IPreferenceNode) element).getId();
			if (defaultId != null && id.equals(defaultId)) {
				defaultNode[0] = element;
			}
			Image image = null;
			if (SystemPreferencePage.ID.equals(id)) {
				// 系统菜单
				image = Activator.getImageDescriptor("images/preference/system/system.png").createImage();
				imageList.add(image);
				return image;
			} else if ("org.eclipse.ui.preferencePages.Keys".equals(id)) {
				// 系统 > 快捷键菜单
				image = Activator.getImageDescriptor("images/preference/system/keys.png").createImage();
				imageList.add(image);
				return image;
			} else if ("org.eclipse.ui.net.proxy_preference_page_context".equals(id)) {
				// 网络连接
				image = Activator.getImageDescriptor("images/preference/system/network.png").createImage();
				imageList.add(image);
				return image;
			}  else {
				return null;
			}
		}
	});

	if (defaultNode[0] != null) {
		dlg.getTreeViewer().setSelection(new StructuredSelection(defaultNode), true);
		dlg.getTreeViewer().getControl().setFocus();
	}

	dlg.open();

	// 清理资源
	for (Image img : imageList) {
		if (img != null && !img.isDisposed()) {
			img.dispose();
		}
	}
	imageList.clear();
} 
开发者ID:heartsome,项目名称:tmxeditor8,代码行数:55,代码来源:PreferenceUtil.java

本文标签属性:

示例:示例英文

代码:代码生成器

java:java游戏

PreferenceManager:PreferenceManager

remove:removebg一键抠图官网

上一篇:C++ CListBox::ResetContent方法代码示例(c++clistbox::resetcontent方法的典型用法代码示例)
下一篇:李佳琦直播千万观看

为您推荐