org.eclipse.e4.core.di.annotations.Optional类的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(82)

本文整理了Java中org.eclipse.e4.core.di.annotations.Optional类的一些代码示例,展示了Optional类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Optional类的具体详情如下:
包路径:org.eclipse.e4.core.di.annotations.Optional
类名称:Optional

Optional介绍

暂无

代码示例

代码示例来源:origin: at.bestsolution.eclipse/org.eclipse.fx.code.editor

public LocalSourceFileInput(Path path, Charset charSet, @Optional EventBus eventBus) {
  this.path = path;
  this.charSet = charSet;
  this.eventBus = eventBus;
}

代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.code.editor

public LocalSourceFileInput(Path path, Charset charSet, @Optional EventBus eventBus) {
  this.path = path;
  this.charSet = charSet;
  this.eventBus = eventBus;
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.e4.ui.workbench

@Inject
public PartServiceImpl(MApplication application, @Optional MWindow window) {
  // no need to track changes:
  this.application = application;
  workbenchWindow = window;
}

代码示例来源:origin: at.bestsolution.eclipse/org.eclipse.fx.code.editor.fx

@Inject
@Optional
public void setActiveInputTracker(@ContextValue("activeInput") Property<Input<?>> activeInput) {
  this.activeInput = activeInput;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.core.services

@Inject
  @Optional
  void setLoggerFactory(LoggerFactory factory) {
    if (factory != null) {
      this.logger = factory.getLogger(getClass());
    } else {
      this.logger = null;
    }
  }
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide

/**
 * @param newInterval
 */
@Inject
@Optional
public void autoSaveIntervalChanged(
    @SuppressWarnings("restriction") @Preference(value = IPreferenceConstants.SAVE_AUTOMATICALLY_INTERVAL, nodePath = "org.eclipse.ui.workbench") int newInterval) {
  autoSaveInterval = TimeUnit.SECONDS.toMillis(newInterval);
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.e4.ui.workbench

/**
 * Creates a new workbench logger
 */
@Inject
public WorkbenchLogger(@Optional @Named("logger.bundlename") String bundleName) {
  super();
  this.bundleName = bundleName == null ? Activator.PI_WORKBENCH : bundleName;
  isDebugEnabled = Platform.inDebugMode();
}

代码示例来源:origin: at.bestsolution.eclipse/org.eclipse.fx.code.editor

@Inject
public LocalSourceFileInput(@Adapt @Named(Constants.DOCUMENT_URL) Path path, @Optional EventBus eventBus) {
  this(path,StandardCharsets.UTF_8, eventBus);
}

代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.code.editor

@Inject
public LocalSourceFileInput(@Adapt @Named(Constants.DOCUMENT_URL) Path path, @Optional EventBus eventBus) {
  this(path,StandardCharsets.UTF_8, eventBus);
}

代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.code.editor.e4

@CanExecute
public boolean canSave(@Named(Constants.EDITOR_DIRTY_FLAG_KEY) @Optional Boolean dirtyFlag) {
  return Boolean.TRUE.equals(dirtyFlag);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.core.services

/**
 * Setting the {@link Locale} by using this method will cause to create new instances for all
 * message classes that were requested before. It also notifys all {@link IRequestor} that
 * requested those messages instance which causes dynamic reinjection.
 *
 * @param locale
 *            The {@link Locale} to use for creating the message instances.
 */
@Inject
public void setLocale(@Optional @Named(TranslationService.LOCALE) Locale locale) {
  this.locale = locale == null ? Locale.getDefault() : locale;
  // update listener
  updateMessages();
}

代码示例来源:origin: org.eclipse.e4.ui/bindings

@Inject
public void setContextIds(@Named(ACTIVE_CONTEXTS) @Optional Set<String> set) {
  if (set == null || set.isEmpty() || contextManager == null) {
    contextSet = ContextSet.EMPTY;
    return;
  }
  ArrayList<Context> contexts = new ArrayList<Context>();
  for (String id : set) {
    contexts.add(contextManager.getContext(id));
  }
  contextSet = manager.createContextSet(contexts);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.bindings

@Inject
public void setContextIds(@Named(ACTIVE_CONTEXTS) @Optional Set<String> set) {
  if (set == null || set.isEmpty() || contextManager == null) {
    contextSet = ContextSet.EMPTY;
    return;
  }
  ArrayList<Context> contexts = new ArrayList<Context>();
  for (String id : set) {
    contexts.add(contextManager.getContext(id));
  }
  contextSet = manager.createContextSet(contexts);
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.e4.ui.workbench

@CanExecute
boolean canExecute(@Optional EPartService partService) {
  if (partService != null) {
    return !partService.getDirtyParts().isEmpty();
  }
  return false;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.workbench.renderers.swt

@Inject
@Optional
void subscribeTopicToBeRenderedChanged(@UIEventTopic(UIEvents.UIElement.TOPIC_TOBERENDERED) Event event) {
  shouldViewMenuBeRendered(event);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.workbench.renderers.swt

@Inject
@Optional
void subscribeTopicClosablePlaceholderChanged(
    @UIEventTopic(UIEvents.Placeholder.TOPIC_CLOSEABLE) Event event) {
  updateClosableTab(event);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.workbench.renderers.swt

@Inject
@Optional
void subscribeTopicVisibleChanged(@UIEventTopic(UIEvents.UIElement.TOPIC_VISIBLE) Event event) {
  shouldViewMenuBeRendered(event);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench

@Inject
@Optional
protected void keybindingPreferencesChanged(
    @SuppressWarnings("restriction") @Preference(nodePath = "org.eclipse.ui.workbench", value = "org.eclipse.ui.commands") String preferenceValue) {
  if (preferenceValue != null) {
    updateQuickAccessText();
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.workbench.renderers.swt

@Inject
@Optional
void subscribeTopicClosablePartChanged(@UIEventTopic(UIEvents.Part.TOPIC_CLOSEABLE) Event event) {
  updateClosableTab(event);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.workbench.renderers.swt

@Inject
@Optional
private void subscribeThemeDefinitionChanged(
    @UIEventTopic(UIEvents.UILifeCycle.THEME_DEFINITION_CHANGED) Event event) {
  themeDefinitionChanged.handleEvent(event);
}

相关文章

微信公众号

最新文章

更多

Optional类方法