本文整理汇总了Java中org.eclipse.e4.core.di.extensions.Preference类的典型用法代码示例。如果您正苦于以下问题:Java Preference类的具体用法?Java Preference怎么用?Java Preference使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Preference类属于org.eclipse.e4.core.di.extensions包,在下文中一共展示了Preference类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createControls
import org.eclipse.e4.core.di.extensions.Preference; //导入依赖的package包/类
@PostConstruct
public void createControls(
IEclipseContext context,
@Preference(nodePath = TermSuiteUI.PLUGIN_ID, value = TermSuiteUIPreferences.WRAP_TEXT) boolean wrap,
final Composite parent,
MPart part,
ILoggerProvider loggerProvider,
EModelService modelService) {
this.logger = loggerProvider.getClassLogger(this.getClass());
parent.setLayout(new FillLayout());
text = new StyledText(parent, getTheStyle(wrap, false));
MToolItem wrapButton = (MToolItem)modelService.find(TOOL_ITEM_WRAP_TEXT, part.getToolbar());
wrapButton.setSelected(wrap);
text.addLineStyleListener(lineStyleListener);
text.addLineBackgroundListener(lineBackgroundListener);
text.setWrapIndent(20);
}
开发者ID:termsuite,项目名称:termsuite-ui,代码行数:21,代码来源:FileEditorPart.java
示例2: reactOnCustomResourceChange
import org.eclipse.e4.core.di.extensions.Preference; //导入依赖的package包/类
@Inject
@Optional
public void reactOnCustomResourceChange(
LinguisticResourcesService lingueeService,
@Preference(value = TermSuiteUIPreferences.ACTIVATE_CUSTOM_RESOURCES) boolean active,
@Preference(value = TermSuiteUIPreferences.LINGUISTIC_RESOURCES_DIRECTORY) String customResourcePath
) {
this.withCustomResources = active;
if(active) {
this.customResourcePath = customResourcePath;
if(this.viewer != null)
this.viewer.collapseToLevel(THE_RESOURCE_NODE, 0);
}
if(this.viewer != null)
this.viewer.setInput(getRootNodes());
}
开发者ID:termsuite,项目名称:termsuite-ui,代码行数:17,代码来源:NavigatorPart.java
示例3: execute
import org.eclipse.e4.core.di.extensions.Preference; //导入依赖的package包/类
@Execute
public void execute(@Preference(nodePath = "org.bbaw.bts.app") IEclipsePreferences prefs, IEclipseContext context,
ApplicationStartupController startupController)
{
// PartHolderDialog dialog = ContextInjectionFactory.make(PartHolderDialog.class, context);
// // context.set(UserManagementDialog.class, dialog);
//
// if (dialog.open() == dialog.OK)
// {
// }
Wizard w = new InstallationWizard(context, startupController, null, null);
WizardDialog dialog = new WizardDialog(new Shell(), w);
if (dialog.open() == dialog.OK)
{
System.out.println("new project created.");
}
}
开发者ID:cplutte,项目名称:bts,代码行数:20,代码来源:TESTER.java
示例4: setShowText
import org.eclipse.e4.core.di.extensions.Preference; //导入依赖的package包/类
@Inject
void setShowText(
@Preference(value = E4PerspectiveSwitcherPreferences.SHOW_TEXT, nodePath = E4PerspectiveSwitcherPreferences.ROOT_PREFERENCES_NODE) boolean showShortcutText) {
this.showShortcutText = showShortcutText;
if (toolBar == null || toolBar.isDisposed())
return;
for (ToolItem item : toolBar.getItems()) {
if (!(item.getData() instanceof MPerspective))
continue;
MPerspective perspective = (MPerspective) item.getData();
if (item.getImage() == null || this.showShortcutText) {
String label = perspective.getLocalizedLabel();
item.setText(label != null ? label : _null);
item.setToolTipText(perspective.getLocalizedTooltip());
} else {
item.setText(_null);
item.setToolTipText(perspective.getLocalizedLabel());
}
}
// update the layout
}
开发者ID:cplutte,项目名称:bts,代码行数:27,代码来源:PerspectiveSwitcherSwtTrim.java
示例5: createControls
import org.eclipse.e4.core.di.extensions.Preference; //导入依赖的package包/类
@PostConstruct
void createControls(final Composite inParent, final IEclipseContext inContext, final EMenuService inService,
final MApplication inApplication,
@Preference(nodePath = RelationsConstants.PREFERENCE_NODE, value = INITIAL_SIZE) final String inInitialSize,
final IBrowserManager inBrowserManager) {
context = inContext;
application = inApplication;
browserManager = inBrowserManager;
createGraphicalViewer(inParent, inContext);
inService.registerContextMenu(viewer.getControl(), Constants.BROWSER_POPUP);
visible = true;
initialSize = getInitialSize(inInitialSize);
setModel(browserManager.getCenterModel());
}
开发者ID:aktion-hip,项目名称:relations,代码行数:17,代码来源:DefaultBrowserPart.java
示例6: afterInit
import org.eclipse.e4.core.di.extensions.Preference; //导入依赖的package包/类
@PostConstruct
void afterInit(
final EMenuService inService,
final EPartService inPartService,
@Preference(value = RelationsConstants.ACTIVE_BROWSER_ID) @Optional final String inBrowserId) {
inService.registerContextMenu(styledText.getControl(),
RelationsConstants.POPUP_INSPECTOR);
// work around to have the application's focus on the browser stack
if (inBrowserId != null) {
final MPart lBrowser = inPartService.findPart(inBrowserId);
if (lBrowser != null) {
inPartService.activate(lBrowser, true);
}
}
}
开发者ID:aktion-hip,项目名称:relations,代码行数:17,代码来源:InspectorView.java
示例7: trackViewMenuSwitch
import org.eclipse.e4.core.di.extensions.Preference; //导入依赖的package包/类
@Inject
void trackViewMenuSwitch(
@Preference(nodePath = RelationsConstants.PREFERENCE_NODE, value = PREF_SWITCH_VALUE) final String inSwitchValue) {
if (inSwitchValue == null) {
return;
}
switchValue = inSwitchValue;
displayType = SWITCH_VALUE_BIBLIO.equals(switchValue) ? DisplayType.TEXT_BIBLIO
: DisplayType.TEXT_CONTENT;
if (initialized && !title.isDisposed() && !styledText.isDisposed()) {
try {
refreshDisplay(item);
}
catch (VException | IOException | SAXException exc) {
log.error(exc, exc.getMessage());
}
}
}
开发者ID:aktion-hip,项目名称:relations,代码行数:19,代码来源:InspectorView.java
示例8: reactOnCustomResourceActiveChange
import org.eclipse.e4.core.di.extensions.Preference; //导入依赖的package包/类
@Inject
@Optional
public void reactOnCustomResourceActiveChange(
LinguisticResourcesService lingueeService,
@Preference(value = TermSuiteUIPreferences.ACTIVATE_CUSTOM_RESOURCES) boolean active
) {
this.withCustomResources = active;
logger.debug("Modification detected in preferences: custom resources are now " + (this.withCustomResources ? "activated": "deactivated") );
resetCache();
}
开发者ID:termsuite,项目名称:termsuite-ui,代码行数:11,代码来源:LinguisticResourcesServiceImpl.java
示例9: reactOnCustomResourceChange
import org.eclipse.e4.core.di.extensions.Preference; //导入依赖的package包/类
@Inject
@Optional
public void reactOnCustomResourceChange(
LinguisticResourcesService lingueeService,
@Preference(value = TermSuiteUIPreferences.COPY_BUILTIN_RESOURCES_IF_EMPTY) boolean copyIfEmpty
) {
this.copyIfEmpty = copyIfEmpty;
logger.debug("Modification detected in preferences: copy built-in resources if target dir empty: " + this.copyIfEmpty);
resetCache();
}
开发者ID:termsuite,项目名称:termsuite-ui,代码行数:11,代码来源:LinguisticResourcesServiceImpl.java
示例10: setServerUri
import org.eclipse.e4.core.di.extensions.Preference; //导入依赖的package包/类
@Inject
public void setServerUri(
@Preference(nodePath = NODEPATH, value = SERVER_URI_PREF_KEY) String serverUri) {
if(serverUri != null) {
this.serverUri = serverUri;
}
}
开发者ID:vogellacompany,项目名称:eclipseenterpriseintegration,代码行数:8,代码来源:RestTodoServiceImpl.java
示例11: setTextColor
import org.eclipse.e4.core.di.extensions.Preference; //导入依赖的package包/类
@Inject
@Optional
void setTextColor(
@Preference(nodePath="org.fipro.eclipse.migration.e4.ui", value="description_color") String color) {
Color toUse = "blue".equals(color) ?
Display.getDefault().getSystemColor(SWT.COLOR_BLUE) : Display.getDefault().getSystemColor(SWT.COLOR_BLACK);
if (description != null && !description.isDisposed()) {
description.setForeground(toUse);
}
}
开发者ID:fipro78,项目名称:e4-cookbook-migration-guide,代码行数:13,代码来源:DescriptionView.java
示例12: createComposite
import org.eclipse.e4.core.di.extensions.Preference; //导入依赖的package包/类
@PostConstruct
public void createComposite(Composite parent, @Preference(value = "prefColor") String colorKey)
{
parent.setLayout(new GridLayout(1, false));
txtInput = new Text(parent, SWT.BORDER);
txtInput.setMessage("Enter text to mark part as dirty");
txtInput.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e)
{
dirty.setDirty(true);
}
});
txtInput.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
tableViewer = new TableViewer(parent);
tableViewer.add("Sample item 1");
tableViewer.add("Sample item 2");
tableViewer.add("Sample item 3");
tableViewer.add("Sample item 4");
tableViewer.add("Sample item 5");
tableViewer.getTable().setLayoutData(new GridData(GridData.FILL_BOTH));
reactOnPrefColorChange(colorKey);
}
开发者ID:opcoach,项目名称:e4Preferences,代码行数:28,代码来源:SamplePart.java
示例13: reactOnPrefColorChange
import org.eclipse.e4.core.di.extensions.Preference; //导入依赖的package包/类
@Inject
@Optional
public void reactOnPrefColorChange(@Preference(value = "prefColor") String colorKey)
{
System.out.println("React on a change in preferences with colorkey = " + colorKey);
if ((colorKey != null) && (tableViewer != null) && !tableViewer.getControl().isDisposed())
{
Color c = getColorFromPref(colorKey);
tableViewer.getTable().setForeground(c);
tableViewer.getTable().redraw();
}
}
开发者ID:opcoach,项目名称:e4Preferences,代码行数:14,代码来源:SamplePart.java
示例14: setPrefReferences
import org.eclipse.e4.core.di.extensions.Preference; //导入依赖的package包/类
@Inject
private void setPrefReferences(
@Preference(nodePath = Activator.PLUGIN_ID) IEclipsePreferences prefDarker,
@Preference(nodePath = "org.eclipse.ui.editors") IEclipsePreferences prefUI,
@Preference(nodePath = "org.eclipse.jdt.ui") IEclipsePreferences prefJDT,
@Preference(nodePath = "org.eclipse.pde.ui") IEclipsePreferences prefPDE) {
this.prefUI = prefUI;
this.prefJDT = prefJDT;
this.prefDarker = prefDarker;
this.prefPDE = prefPDE;
}
开发者ID:jvanzyl,项目名称:eclipse.darker.theme,代码行数:12,代码来源:DarkerThemer.java
示例15: DBSettings
import org.eclipse.e4.core.di.extensions.Preference; //导入依赖的package包/类
/**
* DBSettings constructor, called through DI.
*
* @param inPreferences
* @param inDBController
*/
@Inject
public DBSettings(
@Preference(nodePath = RelationsConstants.PREFERENCE_NODE) final IEclipsePreferences inPreferences,
final IDBController inDBController) {
dbController = inDBController;
dbConnectionConfig = inDBController.getConfiguration(
inPreferences.get(RelationsConstants.KEY_DB_PLUGIN_ID,
RelationsConstants.DFT_DBCONFIG_PLUGIN_ID));
host = inPreferences.get(RelationsConstants.KEY_DB_HOST, ""); //$NON-NLS-1$
catalog = inPreferences.get(RelationsConstants.KEY_DB_CATALOG,
RelationsConstants.DFT_DB_EMBEDDED);
user = inPreferences.get(RelationsConstants.KEY_DB_USER_NAME, ""); //$NON-NLS-1$
password = inPreferences.get(RelationsConstants.KEY_DB_PASSWORD, ""); //$NON-NLS-1$
}
开发者ID:aktion-hip,项目名称:relations,代码行数:21,代码来源:DBSettings.java
示例16: trackDBConfiguration
import org.eclipse.e4.core.di.extensions.Preference; //导入依赖的package包/类
@Inject
@Optional
void trackDBConfiguration(
@Preference(nodePath = RelationsConstants.PREFERENCE_NODE, value = RelationsConstants.KEY_DB_PLUGIN_ID) final String inPluginID) {
if (inPluginID != null) {
dbConnectionConfig = dbController.getConfiguration(inPluginID);
}
}
开发者ID:aktion-hip,项目名称:relations,代码行数:9,代码来源:DBSettings.java
示例17: setViewState
import org.eclipse.e4.core.di.extensions.Preference; //导入依赖的package包/类
@Inject
void setViewState(
@Preference(nodePath = RelationsConstants.PREFERENCE_NODE, value = LastChangesController.LAST_CHANGES_VIEW_TYPE) final String inLastChangeState) {
if (inLastChangeState == null || inLastChangeState.isEmpty()) {
lastChangesType = LastChangesType.LAST_CREATED;
} else {
lastChangesType = Boolean.parseBoolean(inLastChangeState)
? LastChangesType.LAST_CREATED
: LastChangesType.LAST_MODIFIED;
}
}
开发者ID:aktion-hip,项目名称:relations,代码行数:12,代码来源:LastChangesController.java
示例18: trackFontSize
import org.eclipse.e4.core.di.extensions.Preference; //导入依赖的package包/类
@Inject
void trackFontSize(
@Preference(nodePath = RelationsConstants.PREFERENCE_NODE, value = RelationsConstants.KEY_TEXT_FONT_SIZE) final int inFontSize) {
if (textWidget == null || textWidget.isDisposed()) {
fontSizeToUse = inFontSize;
} else {
final FontData lData = textWidget.getFont().getFontData()[0];
if (inFontSize != lData.getHeight()) {
lData.setHeight(inFontSize);
final Font lNewFont = new Font(Display.getCurrent(), lData);
textWidget.setFont(lNewFont);
}
}
}
开发者ID:aktion-hip,项目名称:relations,代码行数:15,代码来源:StyledTextComponent.java
示例19: LanguageService
import org.eclipse.e4.core.di.extensions.Preference; //导入依赖的package包/类
/**
* LanguageService constructor.
*
* @param inLanguageContent
* String the content language (ISO 639 code)
*/
@Inject
public LanguageService(
@Preference(nodePath = RelationsConstants.PREFERENCE_NODE, value = RelationsConstants.KEY_LANGUAGE_CONTENT) final String inLanguageContent) {
appLocale = createLocale();
setContentLanguage(inLanguageContent);
}
开发者ID:aktion-hip,项目名称:relations,代码行数:13,代码来源:LanguageService.java
示例20: setContentLanguage
import org.eclipse.e4.core.di.extensions.Preference; //导入依赖的package包/类
/**
* Tracker for changes of the content language.
*
* @param inLanguageContent
* String language ISO 639 code
*/
@Inject
void setContentLanguage(
@Preference(nodePath = RelationsConstants.PREFERENCE_NODE, value = RelationsConstants.KEY_LANGUAGE_CONTENT) final String inLanguageContent) {
contentLocale = new Locale(
inLanguageContent == null || inLanguageContent.isEmpty() ? RelationsConstants.DFT_LANGUAGE
: inLanguageContent);
}
开发者ID:aktion-hip,项目名称:relations,代码行数:14,代码来源:LanguageService.java
注:本文中的org.eclipse.e4.core.di.extensions.Preference类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论