当前位置: 首页>>代码示例>>Java>>正文


Java ListEditor类代码示例

本文整理汇总了Java中org.eclipse.jface.preference.ListEditor的典型用法代码示例。如果您正苦于以下问题:Java ListEditor类的具体用法?Java ListEditor怎么用?Java ListEditor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ListEditor类属于org.eclipse.jface.preference包,在下文中一共展示了ListEditor类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createFieldEditors

import org.eclipse.jface.preference.ListEditor; //导入依赖的package包/类
@Override
protected void createFieldEditors() {
	addField(new ListEditor(TermSuiteUIPreferences.TAGGERS, "Installed POS taggers/lemmatizers: ", getFieldEditorParent()) {
		@Override
		protected String createList(String[] items) {
			return Joiner.on(TermSuiteUIPreferences.LIST_SEPARATOR_CHAR).join(items);
		}

		@Override
		protected String getNewInputObject() {
			ConfigureTaggerDialog dialog = new ConfigureTaggerDialog(getShell());
			
			if(dialog.open() == Dialog.OK) {
				ETaggerConfig config = dialog.getTaggerConfig();
				return TaggerUtil.toPreferenceString(config);
			} else
				return null;
		}

		@Override
		protected String[] parseString(String stringList) {
			List<String> list = Splitter.on(TermSuiteUIPreferences.LIST_SEPARATOR_CHAR).splitToList(stringList);
			return list.toArray(new String[list.size()]);
		}
	});
	
}
 
开发者ID:termsuite,项目名称:termsuite-ui,代码行数:28,代码来源:TaggerPreferencePage.java

示例2: createFieldEditors

import org.eclipse.jface.preference.ListEditor; //导入依赖的package包/类
@Override
protected void createFieldEditors() {
    final Composite parent = getFieldEditorParent();
    final ListEditor locations = new ListEditor(REMOTE_REPOSITORIES_LOCATION_KEY_NAME, "Remote repositories locations:", parent) {
        @Override
        protected String getNewInputObject() {
            // Give the user an input dialog to enter its new location
            final InputDialog dialog =
                                       new InputDialog(getShell(), "Add a remote Codenvy repository location",
                                                       "Enter the URL of the repository", null, new CodenvyRepositoryValidator());
            if (dialog.open() != Window.OK) {
                return null;
            }

            final String newRepositoryLocation = dialog.getValue();
            if (StringHelper.isNullOrEmpty(newRepositoryLocation)) {
                return null;
            }

            return newRepositoryLocation;
        }

        @Override
        protected String[] parseString(String stringList) {
            return CodenvyPreferencesInitializer.parseString(stringList);
        }

        @Override
        protected String createList(String[] items) {
            return CodenvyPreferencesInitializer.createList(items);
        }
    };

    locations.loadDefault();
    addField(locations);
}
 
开发者ID:codenvy-legacy,项目名称:eclipse-plugin,代码行数:37,代码来源:CodenvyPreferencesPage.java

示例3: createFieldEditors

import org.eclipse.jface.preference.ListEditor; //导入依赖的package包/类
@Override
protected void createFieldEditors() {
	List<String> cmakeGenerators = launcher.retrieveCMakeGenerators();
	String[][] generators = new String[cmakeGenerators.size()][];
	int i = 0;
	for( String generator : cmakeGenerators ) {
		String name = generator.replaceAll("[^-]+-(.*)", "$1").trim();
		generators[i++] = new String[]{name,generator};
	}
	
	buildEnvironmentEditor = new ComboFieldEditor("BUILD_SYS", "Build System", generators, getFieldEditorParent());
	buildEnvironmentEditor.setPreferenceName(Activator.PREF_STORE_BUILD_SYS);
	buildEnvironmentEditor.load();
	
	makeArgsEditor = new StringFieldEditor("MAKE_ARGS", "Make/Ninja Args", getFieldEditorParent());
	makeArgsEditor.setPreferenceName(Activator.PREF_STORE_MAKE_ARGS);
	makeArgsEditor.load();

	cmakeArgsEditor = new StringFieldEditor("CMAKE_ARGS", "CMake Args", getFieldEditorParent());
	cmakeArgsEditor.setPreferenceName(Activator.PREF_STORE_CMAKE_ARGS);
	cmakeArgsEditor.load();

	String[][] entryNamesAndValues = { { "Toolchain path invalid or not set.", Platform.getOSArch() } };
	List<String> toolchains = PluginDataIO.getToolchainArchitectures();
	if (!toolchains.isEmpty()) {
		int index = 0;
		entryNamesAndValues = new String[toolchains.size()][2];
		for (String toolchain : toolchains) {
			entryNamesAndValues[index++] = new String[]{toolchain, toolchain};
		}
	}
	
	defaultToolchain = new ComboFieldEditor("DEF_TOOLCHAIN", "Default-Toolchain", entryNamesAndValues, getFieldEditorParent());
	defaultToolchain.setPreferenceName(Activator.PREF_STORE_DEFAULT_TOOLCHAIN);
	defaultToolchain.load();
	
	defaultBuildtypes = new ListEditor("DEF_BUILDTYPES", "Available Buildtypes", getFieldEditorParent()) {
		
		@Override
		protected String[] parseString(String stringList) {
			return stringList.split(File.pathSeparator);
		}
		
		@Override
		protected String getNewInputObject() {
			InputDialog dialog = new InputDialog(getShell(), "New Buildconfiguration", "Enter the name of the Buildconfiguration to add", "", null);
			if (dialog.open() == InputDialog.OK) {
				return dialog.getValue();
			}
			return null;
		}
		
		@Override
		protected String createList(String[] items) {
			StringBuilder sb = new StringBuilder();
			for (String string : items) {
				sb.append(string).append(File.pathSeparator);
			}
			return sb.toString();
		}
	};
	defaultBuildtypes.setPreferenceName(Activator.PREF_STORE_BUILD_CONF);
	defaultBuildtypes.load();
	
	addField(buildEnvironmentEditor);
	addField(makeArgsEditor);
	addField(cmakeArgsEditor);
	addField(defaultToolchain);
	addField(defaultBuildtypes);

	buildEnvironmentEditor.setPropertyChangeListener(this);
	makeArgsEditor.setPropertyChangeListener(this);
	cmakeArgsEditor.setPropertyChangeListener(this);
	defaultToolchain.setPropertyChangeListener(this);
	defaultBuildtypes.setPropertyChangeListener(this);
}
 
开发者ID:USESystemEngineeringBV,项目名称:cmake-eclipse-helper,代码行数:77,代码来源:CategoryPage.java

示例4: createFieldEditors

import org.eclipse.jface.preference.ListEditor; //导入依赖的package包/类
@Override
protected void createFieldEditors() {
    Composite p = getFieldEditorParent();

    addField(new IntegerFieldEditor(
            CodeCompletionPreferencesInitializer.CHARS_FOR_CTX_INSENSITIVE_MODULES_COMPLETION,
            "Number of chars for showing modules in context-insensitive completions?", p));

    addField(new IntegerFieldEditor(
            CodeCompletionPreferencesInitializer.CHARS_FOR_CTX_INSENSITIVE_TOKENS_COMPLETION,
            "Number of chars for showing global tokens in context-insensitive completions?", p));

    addField(new BooleanFieldEditor(CodeCompletionPreferencesInitializer.USE_KEYWORDS_CODE_COMPLETION,
            "Use common tokens auto code completion?", p));
    addField(new LabelFieldEditor("LabelFieldEditor", "", p));

    addField(new BooleanFieldEditor(CodeCompletionPreferencesInitializer.ADD_SPACE_WHEN_NEEDED,
            "Add <SPACE> for common cases (e.g.: \"and \", \"assert \", etc.)?", p));
    addField(new LabelFieldEditor("LabelFieldEditor", "", p));

    addField(new BooleanFieldEditor(CodeCompletionPreferencesInitializer.ADD_SPACE_AND_COLON_WHEN_NEEDED,
            "Add <SPACE><COLON> for common cases (e.g.: \"class :\", \"if :\", etc.)?", p));
    addField(new LabelFieldEditor("LabelFieldEditor", "", p));

    addField(new BooleanFieldEditor(CodeCompletionPreferencesInitializer.FORCE_PY3K_PRINT_ON_PY2,
            "Force print() function on Python 2.x projects?", p));
    addField(new LabelFieldEditor("LabelFieldEditor", "", p));

    addField(new ListEditor(CodeCompletionPreferencesInitializer.KEYWORDS_CODE_COMPLETION, "Tokens to use:", p) {

        @Override
        protected String createList(String[] items) {
            return KeywordsSimpleAssist.wordsAsString(items);
        }

        @Override
        protected String getNewInputObject() {
            InputDialog d = new InputDialog(getShell(), "New word", "Add the word you wish.", "",
                    new IInputValidator() {

                        @Override
                        public String isValid(String newText) {
                            if (newText.indexOf(' ') != -1) {
                                return "The input cannot have spaces";
                            }
                            return null;
                        }
                    });

            int retCode = d.open();
            if (retCode == InputDialog.OK) {
                return d.getValue();
            }
            return null;
        }

        @Override
        protected String[] parseString(String stringList) {
            return KeywordsSimpleAssist.stringAsWords(stringList);
        }

        @Override
        protected void doFillIntoGrid(Composite parent, int numColumns) {
            super.doFillIntoGrid(parent, numColumns);
            List listControl = getListControl(parent);
            GridData layoutData = (GridData) listControl.getLayoutData();
            layoutData.heightHint = 300;
        }
    });
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:71,代码来源:CodeCompletionPreferencesPage.java

示例5: createFieldEditors

import org.eclipse.jface.preference.ListEditor; //导入依赖的package包/类
@Override
protected void createFieldEditors() {
    Composite p = getFieldEditorParent();

    addField(new BooleanFieldEditor(PydevConsoleConstants.INTERACTIVE_CONSOLE_UMD_ENABLED,
            "Enable UMD", p));
    addField(new LabelFieldEditor("LabelFieldEditor", "", p));

    addField(new BooleanFieldEditor(PydevConsoleConstants.INTERACTIVE_CONSOLE_UMD_VERBOSE,
            "Show reloaded modules list", p));
    addField(new LabelFieldEditor("LabelFieldEditor", "", p));

    addField(new ListEditor(PydevConsoleConstants.INTERACTIVE_CONSOLE_UMD_EXCLUDE_MODULE_LIST,
            "UMD Excluded Modules:", p) {

        @Override
        protected String createList(String[] items) {
            return StringUtils.join(",", items);
        }

        @Override
        protected String[] parseString(String stringList) {
            return stringList.split(",");
        }

        @Override
        protected String getNewInputObject() {
            InputDialog d = new InputDialog(getShell(), "New Excluded Module",
                    "Add the module you want to exclude.", "",
                    new IInputValidator() {
                        @Override
                        public String isValid(String newText) {
                            if (newText.indexOf(',') != -1) {
                                return "The input cannot have a comma";
                            }
                            return null;
                        }
                    });

            if (d.open() == InputDialog.OK) {
                return d.getValue();
            }
            return null;
        }

        @Override
        protected void doFillIntoGrid(Composite parent, int numColumns) {
            super.doFillIntoGrid(parent, numColumns);
            List listControl = getListControl(parent);
            GridData layoutData = (GridData) listControl.getLayoutData();
            layoutData.heightHint = 300;
        }
    });

}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:56,代码来源:InteractiveConsoleUMDPrefs.java


注:本文中的org.eclipse.jface.preference.ListEditor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。