Java 类com.intellij.openapi.components.State 实例源码

项目:tools-idea    文件:PasswordDatabase.java   
/**
 * {@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;
}
项目:consulo    文件:ExportSettingsAction.java   
@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;
}
项目:consulo    文件:PasswordDatabase.java   
/**
 * {@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;
}
项目:logger-folding    文件:LoggerFoldingApplicationSettings.java   
@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);
}
项目:logger-folding    文件:LoggerFoldingProjectSettings.java   
@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);
}
项目:intellij-basisjs-plugin    文件:Storage.java   
public State getState() {
    if (state == null) {
        State newState = new State();
        newState.urlPostfix = "/basisjs-tools/devtool/";
        loadState(newState);
    }

    return state;
}
项目:intellij-ce-playground    文件:DebuggerManagerImpl.java   
@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);
    }
  }
}
项目:intellij-ce-playground    文件:DebuggerManagerImpl.java   
@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);
  }
}
项目:intellij-ce-playground    文件:ClientLibraryManagerImpl.java   
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;
}
项目:intellij-ce-playground    文件:ClientLibraryManagerImpl.java   
@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);
  }
}
项目:intellij-ce-playground    文件:EditorColorsManagerImpl.java   
@Nullable
@Override
public State getState() {
  if (mySchemeManager.getCurrentScheme() != null) {
    String name = mySchemeManager.getCurrentScheme().getName();
    myState.colorScheme = "Default".equals(name) ? null : name;
  }
  return myState;
}
项目:intellij-ce-playground    文件:StoreUtil.java   
@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);
  }
}
项目:intellij-ce-playground    文件:StoreUtil.java   
@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;
}
项目:intellij-ce-playground    文件:TodoView.java   
@Override
public State getState() {
  if (myContentManager != null) {
    // all panel were constructed
    Content content = myContentManager.getSelectedContent();
    state.selectedIndex = myContentManager.getIndexOfContent(content);
  }
  return state;
}
项目:intellij-ce-playground    文件:PluginBuildConfiguration.java   
@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;
}
项目:intellij-ce-playground    文件:PluginBuildConfiguration.java   
@Nullable
@Override
public State getState() {
  state.url = getPluginXmlUrl();
  state.manifest = myManifestFilePointer == null ? null : myManifestFilePointer.getUrl();
  return state;
}
项目:intellij-ce-playground    文件:PluginBuildConfiguration.java   
@Override
public void loadState(State state) {
  this.state = state;
  if (state.url != null) {
    myPluginXmlContainer.getConfiguration().replaceConfigFile(PluginDescriptorConstants.META_DATA, state.url);
  }
  if (state.manifest != null) {
    setManifestPath(VfsUtilCore.urlToPath(state.manifest));
  }
}
项目:vso-intellij    文件:TFSConfigurationManager.java   
public void loadState(final State state) {
  myServersConfig = state.config;
  myUseIdeaHttpProxy = state.useIdeaHttpProxy;
  mySupportTfsCheckinPolicies = state.supportTfsCheckinPolicies;
  mySupportStatefulCheckinPolicies = state.supportStatefulCheckinPolicies;
  myReportNotInstalledCheckinPolicies = state.reportNotInstalledCheckinPolicies;
}
项目:vso-intellij    文件:TFSConfigurationManager.java   
public State getState() {
  final State state = new State();
  state.config = myServersConfig;
  state.supportStatefulCheckinPolicies = mySupportStatefulCheckinPolicies;
  state.supportTfsCheckinPolicies = mySupportTfsCheckinPolicies;
  state.useIdeaHttpProxy = myUseIdeaHttpProxy;
  state.reportNotInstalledCheckinPolicies = myReportNotInstalledCheckinPolicies;
  return state;
}
项目:intellij-demandware    文件:DWSettingsProvider.java   
@Override
public void loadState(State state) {
    myState.hostname = state.hostname;
    myState.username = state.username;
    myState.passwordKey = state.passwordKey;
    myState.version = state.version;
    myState.autoUploadEnabled = state.autoUploadEnabled;
}
项目:Dynatrace-AppMon-IntelliJ-IDEA-Integration-Plugin    文件:DynatraceSettingsProvider.java   
@Override
@NotNull
public DynatraceSettingsProvider.State getState() {
    if (this.state == null) {
        this.state = new DynatraceSettingsProvider.State();
    }
    return this.state;
}
项目:Dynatrace-AppMon-IntelliJ-IDEA-Integration-Plugin    文件:DynatraceSettingsProvider.java   
@Override
public void loadState(DynatraceSettingsProvider.State state) {
    if (state == null) {
        this.state = new DynatraceSettingsProvider.State();
    }
    this.state = state;
}
项目:JHelper    文件:Configurator.java   
public State(
        String author,
        String tasksDirectory,
        String outputFile,
        String runFile,
        boolean codeEliminationOn,
        boolean codeReformattingOn
) {
    this.author = author;
    this.tasksDirectory = tasksDirectory;
    this.outputFile = outputFile;
    this.runFile = runFile;
    this.codeEliminationOn = codeEliminationOn;
    this.codeReformattingOn = codeReformattingOn;
}
项目:intellij-pants-plugin    文件:PantsLocalSettings.java   
@Nullable
@Override
public State getState() {
  State state = new State();
  fillState(state);
  return state;
}
项目:consulo-terminal    文件:TerminalOptionsProvider.java   
@Override
public void loadState(State state)
{
    myState.myShellPath = state.myShellPath;
    myState.myCloseSessionOnLogout = state.myCloseSessionOnLogout;
    myState.myReportMouse = state.myReportMouse;
    myState.mySoundBell = state.mySoundBell;
    myState.myTabName = state.myTabName;
    myState.myCopyOnSelection = state.myCopyOnSelection;
    myState.myPasteOnMiddleMouseButton = state.myPasteOnMiddleMouseButton;
    myState.myOverrideIdeShortcuts = state.myOverrideIdeShortcuts;
}
项目:consulo    文件:RunDashboardManagerImpl.java   
@Nullable
@Override
public State getState() {
  State state = new State();
  state.ruleStates = myGroupers.stream().filter(grouper -> !grouper.getRule().isAlwaysEnabled())
          .map(grouper -> new RuleState(grouper.getRule().getName(), grouper.isEnabled())).collect(Collectors.toList());
  return state;
}
项目:consulo    文件:RunDashboardManagerImpl.java   
@Override
public void loadState(State state) {
  state.ruleStates.forEach(ruleState -> {
    for (DashboardGrouper grouper : myGroupers) {
      if (grouper.getRule().getName().equals(ruleState.name) && !grouper.getRule().isAlwaysEnabled()) {
        grouper.setEnabled(ruleState.enabled);
        return;
      }
    }
  });
}
项目:consulo    文件:TodoView.java   
@Override
public State getState() {
  if (myContentManager != null) {
    // all panel were constructed
    Content content = myContentManager.getSelectedContent();
    state.selectedIndex = myContentManager.getIndexOfContent(content);
  }
  return state;
}
项目:consulo-java    文件:DebuggerManagerImpl.java   
@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);
        }
    }
}
项目:consulo-java    文件:DebuggerManagerImpl.java   
@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);
    }
}
项目:intellij-postfix-templates    文件:CptApplicationSettings.java   
@Nullable
@Override
public State getState() {
    return state;
}
项目:intellij-postfix-templates    文件:CptApplicationSettings.java   
@Override
public void loadState(State state) {
    XmlSerializerUtil.copyBean(state, this.state);
}
项目:educational-plugin    文件:CCSettings.java   
@Nullable
@Override
public State getState() {
  return myState;
}
项目:educational-plugin    文件:CCSettings.java   
@Override
public void loadState(State state) {
  myState = state;
}
项目:educational-plugin    文件:KotlinStudyTwitterSettings.java   
@Nullable
@Override
public State getState() {
    return myState;
}
项目:educational-plugin    文件:KotlinStudyTwitterSettings.java   
@Override
public void loadState(State state) {
    myState = state;
}
项目:vartrans    文件:Config.java   
@Nullable
@Override
public State getState() {
    return this.state;
}
项目:vartrans    文件:Config.java   
@Override
public void loadState(State state) {
    XmlSerializerUtil.copyBean(state, this.state);
}
项目:logger-folding    文件:LoggerFoldingApplicationSettings.java   
@NotNull
@Override
public State getState() {
  return state;
}
项目:logger-folding    文件:LoggerFoldingApplicationSettings.java   
@Override
public void loadState(State state) {
  this.state = state;
}