當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。