本文整理汇总了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;
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
}
}
示例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);
}
}
示例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;
}
示例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);
}
}
示例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;
}
示例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);
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}