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


Java State类代码示例

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


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

示例1: getState

import com.intellij.openapi.components.State; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
public State getState() {
  TreeMap<ByteArrayWrapper, byte[]> sorted;
  String pi;
  synchronized (myDatabase) {
    pi = toHex(myMasterPasswordInfo);
    sorted = new TreeMap<ByteArrayWrapper, byte[]>(myDatabase);
  }
  String[][] db = new String[2][sorted.size()];
  int i = 0;
  for (Map.Entry<ByteArrayWrapper, byte[]> e : sorted.entrySet()) {
    db[0][i] = toHex(e.getKey().unwrap());
    db[1][i] = toHex(e.getValue());
    i++;
  }
  State s = new State();
  s.PASSWORDS = db;
  s.MASTER_PASSWORD_INFO = pi;
  return s;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:23,代码来源:PasswordDatabase.java

示例2: getComponentPresentableName

import com.intellij.openapi.components.State; //导入依赖的package包/类
@Nonnull
private static String getComponentPresentableName(@Nonnull State state, @Nonnull Class<?> aClass, @Nullable PluginDescriptor pluginDescriptor) {
  String defaultName = state.name();
  String resourceBundleName;
  if (pluginDescriptor != null && pluginDescriptor instanceof IdeaPluginDescriptor && !PluginManagerCore.CORE_PLUGIN.equals(pluginDescriptor.getPluginId())) {
    resourceBundleName = ((IdeaPluginDescriptor)pluginDescriptor).getResourceBundleBaseName();
  }
  else {
    resourceBundleName = OptionsBundle.PATH_TO_BUNDLE;
  }

  if (resourceBundleName == null) {
    return defaultName;
  }

  ClassLoader classLoader = pluginDescriptor == null ? null : pluginDescriptor.getPluginClassLoader();
  classLoader = classLoader == null ? aClass.getClassLoader() : classLoader;
  if (classLoader != null) {
    ResourceBundle bundle = AbstractBundle.getResourceBundle(resourceBundleName, classLoader);
    if (bundle != null) {
      return CommonBundle.messageOrDefault(bundle, "exportable." + defaultName + ".presentable.name", defaultName);
    }
  }
  return defaultName;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:26,代码来源:ExportSettingsAction.java

示例3: equals

import com.intellij.openapi.components.State; //导入依赖的package包/类
@Override
public boolean equals(Object o) {
  if (this == o) return true;
  if (o == null || getClass() != o.getClass()) return false;

  State state = (State) o;

  return collapseByDefault.equals(state.collapseByDefault);
}
 
开发者ID:healarconr,项目名称:logger-folding,代码行数:10,代码来源:LoggerFoldingApplicationSettings.java

示例4: equals

import com.intellij.openapi.components.State; //导入依赖的package包/类
@Override
public boolean equals(Object o) {
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  State state = (State) o;
  return Objects.equals(canonicalNames, state.canonicalNames);
}
 
开发者ID:healarconr,项目名称:logger-folding,代码行数:12,代码来源:LoggerFoldingProjectSettings.java

示例5: getState

import com.intellij.openapi.components.State; //导入依赖的package包/类
public State getState() {
    if (state == null) {
        State newState = new State();
        newState.urlPostfix = "/basisjs-tools/devtool/";
        loadState(newState);
    }

    return state;
}
 
开发者ID:smelukov,项目名称:intellij-basisjs-plugin,代码行数:10,代码来源:Storage.java

示例6: changeEvent

import com.intellij.openapi.components.State; //导入依赖的package包/类
@Override
public void changeEvent(@NotNull DebuggerContextImpl newContext, DebuggerSession.Event event) {

  final DebuggerSession session = newContext.getDebuggerSession();
  if (event == DebuggerSession.Event.PAUSE && myDebuggerStateManager.myDebuggerSession != session) {
    // if paused in non-active session; switch current session
    myDebuggerStateManager.setState(newContext, session != null? session.getState() : DebuggerSession.State.DISPOSED, event, null);
    return;
  }

  if (myDebuggerStateManager.myDebuggerSession == session) {
    myDebuggerStateManager.fireStateChanged(newContext, event);
  }
  if (event == DebuggerSession.Event.ATTACHED) {
    myDispatcher.getMulticaster().sessionAttached(session);
  }
  else if (event == DebuggerSession.Event.DETACHED) {
    myDispatcher.getMulticaster().sessionDetached(session);
  }
  else if (event == DebuggerSession.Event.DISPOSE) {
    dispose(session);
    if (myDebuggerStateManager.myDebuggerSession == session) {
      myDebuggerStateManager
        .setState(DebuggerContextImpl.EMPTY_CONTEXT, DebuggerSession.State.DISPOSED, DebuggerSession.Event.DISPOSE, null);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:DebuggerManagerImpl.java

示例7: setState

import com.intellij.openapi.components.State; //导入依赖的package包/类
@Override
public void setState(@NotNull final DebuggerContextImpl context, DebuggerSession.State state, DebuggerSession.Event event, String description) {
  ApplicationManager.getApplication().assertIsDispatchThread();
  myDebuggerSession = context.getDebuggerSession();
  if (myDebuggerSession != null) {
    myDebuggerSession.getContextManager().setState(context, state, event, description);
  }
  else {
    fireStateChanged(context, event);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:DebuggerManagerImpl.java

示例8: getState

import com.intellij.openapi.components.State; //导入依赖的package包/类
public State getState() {
  State result = new State();
  for (Map.Entry<String, List<File>> entry : myFiles.entrySet()) {
    DownloadedLibraryState libraryState = new DownloadedLibraryState();
    libraryState.myId = entry.getKey();
    for (File file : entry.getValue()) {
      libraryState.myPaths.add(FileUtil.toSystemIndependentName(file.getAbsolutePath()));
    }
    result.myLibraries.add(libraryState);
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:ClientLibraryManagerImpl.java

示例9: loadState

import com.intellij.openapi.components.State; //导入依赖的package包/类
@Override
public void loadState(State state) {
  myFiles = new HashMap<String, List<File>>();
  for (DownloadedLibraryState libraryState : state.myLibraries) {
    List<File> files = new ArrayList<File>();
    for (String path : libraryState.myPaths) {
      files.add(new File(path));
    }
    myFiles.put(libraryState.myId, files);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:ClientLibraryManagerImpl.java

示例10: getState

import com.intellij.openapi.components.State; //导入依赖的package包/类
@Nullable
@Override
public State getState() {
  if (mySchemeManager.getCurrentScheme() != null) {
    String name = mySchemeManager.getCurrentScheme().getName();
    myState.colorScheme = "Default".equals(name) ? null : name;
  }
  return myState;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:EditorColorsManagerImpl.java

示例11: getStateSpecOrError

import com.intellij.openapi.components.State; //导入依赖的package包/类
@NotNull
public static State getStateSpecOrError(@NotNull Class<? extends PersistentStateComponent> componentClass) {
  State spec = getStateSpec(componentClass);
  if (spec != null) {
    return spec;
  }

  PluginId pluginId = PluginManagerCore.getPluginByClassName(componentClass.getName());
  if (pluginId == null) {
    throw new RuntimeException("No @State annotation found in " + componentClass);
  }
  else {
    throw new PluginException("No @State annotation found in " + componentClass, pluginId);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:StoreUtil.java

示例12: getStateSpec

import com.intellij.openapi.components.State; //导入依赖的package包/类
@Nullable
public static State getStateSpec(@NotNull Class<?> aClass) {
  do {
    State stateSpec = aClass.getAnnotation(State.class);
    if (stateSpec != null) {
      return stateSpec;
    }
  }
  while ((aClass = aClass.getSuperclass()) != null);
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:StoreUtil.java

示例13: getState

import com.intellij.openapi.components.State; //导入依赖的package包/类
@Override
public State getState() {
  if (myContentManager != null) {
    // all panel were constructed
    Content content = myContentManager.getSelectedContent();
    state.selectedIndex = myContentManager.getIndexOfContent(content);
  }
  return state;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:TodoView.java

示例14: equals

import com.intellij.openapi.components.State; //导入依赖的package包/类
@Override
public boolean equals(Object o) {
  if (this == o) return true;
  if (o == null || getClass() != o.getClass()) return false;

  State state = (State)o;

  if (url != null ? !url.equals(state.url) : state.url != null) return false;
  if (manifest != null ? !manifest.equals(state.manifest) : state.manifest != null) return false;

  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:PluginBuildConfiguration.java

示例15: getState

import com.intellij.openapi.components.State; //导入依赖的package包/类
@Nullable
@Override
public State getState() {
  state.url = getPluginXmlUrl();
  state.manifest = myManifestFilePointer == null ? null : myManifestFilePointer.getUrl();
  return state;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:PluginBuildConfiguration.java


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