/** * {@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; }
@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; }
@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); }
@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); }
public State getState() { if (state == null) { State newState = new State(); newState.urlPostfix = "/basisjs-tools/devtool/"; loadState(newState); } return state; }
@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); } } }
@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); } }
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; }
@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); } }
@Nullable @Override public State getState() { if (mySchemeManager.getCurrentScheme() != null) { String name = mySchemeManager.getCurrentScheme().getName(); myState.colorScheme = "Default".equals(name) ? null : name; } return myState; }
@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); } }
@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; }
@Override public State getState() { if (myContentManager != null) { // all panel were constructed Content content = myContentManager.getSelectedContent(); state.selectedIndex = myContentManager.getIndexOfContent(content); } return state; }
@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; }
@Nullable @Override public State getState() { state.url = getPluginXmlUrl(); state.manifest = myManifestFilePointer == null ? null : myManifestFilePointer.getUrl(); return state; }
@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)); } }
public void loadState(final State state) { myServersConfig = state.config; myUseIdeaHttpProxy = state.useIdeaHttpProxy; mySupportTfsCheckinPolicies = state.supportTfsCheckinPolicies; mySupportStatefulCheckinPolicies = state.supportStatefulCheckinPolicies; myReportNotInstalledCheckinPolicies = state.reportNotInstalledCheckinPolicies; }
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; }
@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; }
@Override @NotNull public DynatraceSettingsProvider.State getState() { if (this.state == null) { this.state = new DynatraceSettingsProvider.State(); } return this.state; }
@Override public void loadState(DynatraceSettingsProvider.State state) { if (state == null) { this.state = new DynatraceSettingsProvider.State(); } this.state = state; }
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; }
@Nullable @Override public State getState() { State state = new State(); fillState(state); return state; }
@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; }
@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; }
@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; } } }); }
@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); } } }
@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); } }
@Nullable @Override public State getState() { return state; }
@Override public void loadState(State state) { XmlSerializerUtil.copyBean(state, this.state); }
@Nullable @Override public State getState() { return myState; }
@Override public void loadState(State state) { myState = state; }
@Nullable @Override public State getState() { return this.state; }
@NotNull @Override public State getState() { return state; }
@Override public void loadState(State state) { this.state = state; }