Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 123033 Details for
Bug 226618
[context] move task-specific editor memento storage out of the plug-in preference store
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
patch in progress
clipboard.txt (text/plain), 21.34 KB, created by
Steffen Pingel
on 2009-01-20 01:10:57 EST
(
hide
)
Description:
patch in progress
Filename:
MIME Type:
Creator:
Steffen Pingel
Created:
2009-01-20 01:10:57 EST
Size:
21.34 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.context.ui >Index: src/org/eclipse/mylyn/internal/context/ui/ContextUiPlugin.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.context.ui/src/org/eclipse/mylyn/internal/context/ui/ContextUiPlugin.java,v >retrieving revision 1.35 >diff -u -r1.35 ContextUiPlugin.java >--- src/org/eclipse/mylyn/internal/context/ui/ContextUiPlugin.java 22 Dec 2008 20:16:45 -0000 1.35 >+++ src/org/eclipse/mylyn/internal/context/ui/ContextUiPlugin.java 20 Jan 2009 06:09:50 -0000 >@@ -11,6 +11,7 @@ > > package org.eclipse.mylyn.internal.context.ui; > >+import java.io.File; > import java.util.ArrayList; > import java.util.Collections; > import java.util.HashMap; >@@ -27,6 +28,7 @@ > import org.eclipse.core.runtime.IExtension; > import org.eclipse.core.runtime.IExtensionPoint; > import org.eclipse.core.runtime.IExtensionRegistry; >+import org.eclipse.core.runtime.IPath; > import org.eclipse.core.runtime.IStatus; > import org.eclipse.core.runtime.Platform; > import org.eclipse.core.runtime.Status; >@@ -208,6 +210,8 @@ > > private ContextEditorManager editorManager; > >+ private ContextMementoManager mementoManager; >+ > public ContextUiPlugin() { > INSTANCE = this; > } >@@ -256,7 +260,9 @@ > MonitorUi.addWindowPerspectiveListener(perspectiveManager); > TasksUi.getTaskActivityManager().addActivationListener(TASK_ACTIVATION_LISTENER); > >- editorManager = new ContextEditorManager(); >+ mementoManager = new ContextMementoManager(getContextMementoPath()); >+ >+ editorManager = new ContextEditorManager(mementoManager); > ContextCore.getContextManager().addListener(editorManager); > } catch (Exception e) { > StatusHandler.log(new Status(IStatus.ERROR, ContextUiPlugin.ID_PLUGIN, "Context UI initialization failed", //$NON-NLS-1$ >@@ -645,4 +651,15 @@ > public static ContextPerspectiveManager getPerspectiveManager() { > return INSTANCE.perspectiveManager; > } >+ >+ private File getContextMementoPath() { >+ IPath stateLocation = Platform.getStateLocation(getBundle()); >+ IPath cacheFile = stateLocation.append("workbench"); //$NON-NLS-1$ >+ return cacheFile.toFile(); >+ } >+ >+ public ContextMementoManager getMementoManager() { >+ return mementoManager; >+ } >+ > } >Index: src/org/eclipse/mylyn/internal/context/ui/ContextEditorManager.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.context.ui/src/org/eclipse/mylyn/internal/context/ui/ContextEditorManager.java,v >retrieving revision 1.14 >diff -u -r1.14 ContextEditorManager.java >--- src/org/eclipse/mylyn/internal/context/ui/ContextEditorManager.java 3 Dec 2008 03:14:20 -0000 1.14 >+++ src/org/eclipse/mylyn/internal/context/ui/ContextEditorManager.java 20 Jan 2009 06:09:50 -0000 >@@ -11,9 +11,6 @@ > > package org.eclipse.mylyn.internal.context.ui; > >-import java.io.IOException; >-import java.io.StringReader; >-import java.io.StringWriter; > import java.util.ArrayList; > import java.util.Arrays; > import java.util.HashSet; >@@ -23,8 +20,6 @@ > import org.eclipse.core.runtime.IStatus; > import org.eclipse.core.runtime.MultiStatus; > import org.eclipse.core.runtime.Status; >-import org.eclipse.core.runtime.preferences.InstanceScope; >-import org.eclipse.jface.preference.IPreferenceStore; > import org.eclipse.mylyn.commons.core.StatusHandler; > import org.eclipse.mylyn.context.core.AbstractContextListener; > import org.eclipse.mylyn.context.core.AbstractContextStructureBridge; >@@ -46,15 +41,12 @@ > import org.eclipse.ui.IWorkbenchWindow; > import org.eclipse.ui.PartInitException; > import org.eclipse.ui.PlatformUI; >-import org.eclipse.ui.XMLMemento; > import org.eclipse.ui.internal.EditorManager; > import org.eclipse.ui.internal.IPreferenceConstants; > import org.eclipse.ui.internal.IWorkbenchConstants; > import org.eclipse.ui.internal.Workbench; >-import org.eclipse.ui.internal.WorkbenchMessages; > import org.eclipse.ui.internal.WorkbenchPage; > import org.eclipse.ui.internal.WorkbenchWindow; >-import org.eclipse.ui.preferences.ScopedPreferenceStore; > > /** > * @author Mik Kersten >@@ -79,10 +71,13 @@ > private boolean previousCloseEditorsSetting = Workbench.getInstance().getPreferenceStore().getBoolean( > IPreferenceConstants.REUSE_EDITORS_BOOLEAN); > >- private final IPreferenceStore preferenceStore; >+ //private final IPreferenceStore preferenceStore; > >- public ContextEditorManager() { >- preferenceStore = new ScopedPreferenceStore(new InstanceScope(), "org.eclipse.mylyn.resources.ui"); //$NON-NLS-1$ >+ private final ContextMementoManager mementoManager; >+ >+ public ContextEditorManager(ContextMementoManager mementoManager) { >+ this.mementoManager = mementoManager; >+ //preferenceStore = new ScopedPreferenceStore(new InstanceScope(), "org.eclipse.mylyn.resources.ui"); //$NON-NLS-1$ > } > > @Override >@@ -103,25 +98,32 @@ > // TODO change where memento is stored > IWorkbenchWindow activeWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); > try { >- mementoString = readEditorMemento(context); >- if (mementoString != null && !mementoString.trim().equals("")) { //$NON-NLS-1$ >- IMemento memento = XMLMemento.createReadRoot(new StringReader(mementoString)); >- IMemento[] children = memento.getChildren(KEY_MONITORED_WINDOW_OPEN_EDITORS); >- if (children.length > 0) { >- // This code supports restore from multiple windows >- for (IMemento child : children) { >- WorkbenchPage page = getWorkbenchPageForMemento(child, activeWindow); >- if (child != null && page != null) { >- restoreEditors(page, child, page.getWorkbenchWindow() == activeWindow); >+ try { >+ ContextMemento state = mementoManager.lock(context); >+ //mementoString = readEditorMemento(context); >+// if (mementoString != null && !mementoString.trim().equals("")) { //$NON-NLS-1$ >+// IMemento memento = XMLMemento.createReadRoot(new StringReader(mementoString)); >+ IMemento memento = state.getMemento("editors"); >+ if (memento != null) { >+ IMemento[] children = memento.getChildren(KEY_MONITORED_WINDOW_OPEN_EDITORS); >+ if (children.length > 0) { >+ // This code supports restore from multiple windows >+ for (IMemento child : children) { >+ WorkbenchPage page = getWorkbenchPageForMemento(child, activeWindow); >+ if (child != null && page != null) { >+ restoreEditors(page, child, page.getWorkbenchWindow() == activeWindow); >+ } >+ } >+ } else { >+ // This code is for supporting the old editor management - only the active window >+ WorkbenchPage page = (WorkbenchPage) activeWindow.getActivePage(); >+ if (memento != null) { >+ restoreEditors(page, memento, true); > } >- } >- } else { >- // This code is for supporting the old editor management - only the active window >- WorkbenchPage page = (WorkbenchPage) activeWindow.getActivePage(); >- if (memento != null) { >- restoreEditors(page, memento, true); > } > } >+ } finally { >+ mementoManager.unlock(context); > } > } catch (Exception e) { > StatusHandler.log(new Status(IStatus.ERROR, ContextUiPlugin.ID_PLUGIN, >@@ -196,9 +198,9 @@ > return null; > } > >- private String readEditorMemento(IInteractionContext context) { >- return preferenceStore.getString(PREFS_PREFIX + context.getHandleIdentifier()); >- } >+// private String readEditorMemento(IInteractionContext context) { >+// return preferenceStore.getString(PREFS_PREFIX + context.getHandleIdentifier()); >+// } > > @Override > public void contextDeactivated(IInteractionContext context) { >@@ -207,35 +209,42 @@ > IContextUiPreferenceContstants.AUTO_MANAGE_EDITORS)) { > closeAllButActiveTaskEditor(context.getHandleIdentifier()); > >- XMLMemento rootMemento = XMLMemento.createWriteRoot(KEY_CONTEXT_EDITORS); >+ //XMLMemento rootMemento = XMLMemento.createWriteRoot(KEY_CONTEXT_EDITORS); > > IWorkbenchWindow activeWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); > IWorkbenchWindow launchingWindow = MonitorUi.getLaunchingWorkbenchWindow(); > Set<IWorkbenchWindow> monitoredWindows = MonitorUi.getMonitoredWindows(); > >- for (IWorkbenchWindow window : monitoredWindows) { >- IMemento memento = rootMemento.createChild(KEY_MONITORED_WINDOW_OPEN_EDITORS); >- >- memento.putString(ATTRIBUTE_CLASS, window.getClass().getCanonicalName()); >- int number = 0; >- if (window instanceof WorkbenchWindow) { >- number = ((WorkbenchWindow) window).getNumber(); >- } >- memento.putInteger(ATTRIBUTE_NUMER, number); >- // TODO e3.4 replace by memento.putBoolean() >- memento.putString(ATTRIBUTE_IS_LAUNCHING, (window == launchingWindow) ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ >- memento.putString(ATTRIBUTE_IS_ACTIVE, (window == activeWindow) ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ >- ((WorkbenchPage) window.getActivePage()).getEditorManager().saveState(memento); >- } >- // TODO: avoid storing with preferences due to bloat? >- StringWriter writer = new StringWriter(); > try { >- rootMemento.save(writer); >- writeEditorMemento(context, writer.getBuffer().toString()); >- } catch (IOException e) { >- StatusHandler.log(new Status(IStatus.ERROR, ContextUiPlugin.ID_PLUGIN, "Could not store editor state", //$NON-NLS-1$ >- e)); >+ ContextMemento state = mementoManager.lock(context); >+ IMemento rootMemento = state.createMemento("editors"); >+ for (IWorkbenchWindow window : monitoredWindows) { >+ IMemento memento = rootMemento.createChild(KEY_MONITORED_WINDOW_OPEN_EDITORS); >+ >+ memento.putString(ATTRIBUTE_CLASS, window.getClass().getCanonicalName()); >+ int number = 0; >+ if (window instanceof WorkbenchWindow) { >+ number = ((WorkbenchWindow) window).getNumber(); >+ } >+ memento.putInteger(ATTRIBUTE_NUMER, number); >+ // TODO e3.4 replace by memento.putBoolean() >+ memento.putString(ATTRIBUTE_IS_LAUNCHING, (window == launchingWindow) ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ >+ memento.putString(ATTRIBUTE_IS_ACTIVE, (window == activeWindow) ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ >+ ((WorkbenchPage) window.getActivePage()).getEditorManager().saveState(memento); >+ } >+ state.setChanged(true); >+ } finally { >+ mementoManager.unlock(context); > } >+// // TODO: avoid storing with preferences due to bloat? >+// StringWriter writer = new StringWriter(); >+// try { >+// rootMemento.save(writer); >+// writeEditorMemento(context, writer.getBuffer().toString()); >+// } catch (IOException e) { >+// StatusHandler.log(new Status(IStatus.ERROR, ContextUiPlugin.ID_PLUGIN, "Could not store editor state", //$NON-NLS-1$ >+// e)); >+// } > > Workbench.getInstance().getPreferenceStore().setValue(IPreferenceConstants.REUSE_EDITORS_BOOLEAN, > previousCloseEditorsSetting); >@@ -243,9 +252,9 @@ > } > } > >- public void writeEditorMemento(IInteractionContext context, String memento) { >- preferenceStore.setValue(PREFS_PREFIX + context.getHandleIdentifier(), memento); >- } >+// public void writeEditorMemento(IInteractionContext context, String memento) { >+// preferenceStore.setValue(PREFS_PREFIX + context.getHandleIdentifier(), memento); >+// } > > @Override > public void contextCleared(IInteractionContext context) { >@@ -253,16 +262,24 @@ > return; > } > closeAllButActiveTaskEditor(context.getHandleIdentifier()); >- XMLMemento memento = XMLMemento.createWriteRoot(KEY_CONTEXT_EDITORS); > >- // TODO: avoid storing with preferences due to bloat? >- StringWriter writer = new StringWriter(); > try { >- memento.save(writer); >- writeEditorMemento(context, writer.getBuffer().toString()); >- } catch (IOException e) { >- StatusHandler.log(new Status(IStatus.ERROR, ContextUiPlugin.ID_PLUGIN, "Could not store editor state", e)); //$NON-NLS-1$ >- } >+ ContextMemento state = mementoManager.lock(context); >+ state.removeMemento("editors"); >+ state.setChanged(true); >+ } finally { >+ mementoManager.unlock(context); >+ } >+// XMLMemento memento = XMLMemento.createWriteRoot(KEY_CONTEXT_EDITORS); >+// >+// // TODO: avoid storing with preferences due to bloat? >+// StringWriter writer = new StringWriter(); >+// try { >+// memento.save(writer); >+// writeEditorMemento(context, writer.getBuffer().toString()); >+// } catch (IOException e) { >+// StatusHandler.log(new Status(IStatus.ERROR, ContextUiPlugin.ID_PLUGIN, "Could not store editor state", e)); //$NON-NLS-1$ >+// } > > Workbench.getInstance().getPreferenceStore().setValue(IPreferenceConstants.REUSE_EDITORS_BOOLEAN, > previousCloseEditorsSetting); >@@ -277,8 +294,7 @@ > EditorManager editorManager = page.getEditorManager(); > final ArrayList visibleEditors = new ArrayList(5); > final IEditorReference activeEditor[] = new IEditorReference[1]; >- final MultiStatus result = new MultiStatus(PlatformUI.PLUGIN_ID, IStatus.OK, >- "", null); //$NON-NLS-1$ >+ final MultiStatus result = new MultiStatus(PlatformUI.PLUGIN_ID, IStatus.OK, "", null); //$NON-NLS-1$ > > try { > IMemento[] editorMementos = memento.getChildren(IWorkbenchConstants.TAG_EDITOR); >Index: src/org/eclipse/mylyn/internal/context/ui/ContextMementoManager.java >=================================================================== >RCS file: src/org/eclipse/mylyn/internal/context/ui/ContextMementoManager.java >diff -N src/org/eclipse/mylyn/internal/context/ui/ContextMementoManager.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/internal/context/ui/ContextMementoManager.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,173 @@ >+/******************************************************************************* >+ * Copyright (c) 2004, 2008 Tasktop Technologies and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Tasktop Technologies - initial API and implementation >+ *******************************************************************************/ >+ >+package org.eclipse.mylyn.internal.context.ui; >+ >+import java.io.BufferedReader; >+import java.io.BufferedWriter; >+import java.io.File; >+import java.io.FileInputStream; >+import java.io.FileOutputStream; >+import java.io.IOException; >+import java.io.InputStreamReader; >+import java.io.OutputStreamWriter; >+import java.util.HashMap; >+import java.util.Map; >+ >+import org.eclipse.core.runtime.Assert; >+import org.eclipse.core.runtime.IProgressMonitor; >+import org.eclipse.core.runtime.IStatus; >+import org.eclipse.core.runtime.MultiStatus; >+import org.eclipse.core.runtime.Status; >+import org.eclipse.core.runtime.jobs.Job; >+import org.eclipse.mylyn.commons.core.StatusHandler; >+import org.eclipse.mylyn.context.core.IInteractionContext; >+import org.eclipse.mylyn.internal.provisional.tasks.core.TasksUtil; >+import org.eclipse.osgi.util.NLS; >+import org.eclipse.ui.WorkbenchException; >+import org.eclipse.ui.XMLMemento; >+ >+/** >+ * @author Steffen Pingel >+ */ >+public class ContextMementoManager { >+ >+ private class FlushJob extends Job { >+ >+ public FlushJob() { >+ super("Flush context mementos"); //$NON-NLS-1$ >+ } >+ >+ @Override >+ protected IStatus run(IProgressMonitor monitor) { >+ ContextMementoManager.this.flushPending(); >+ return Status.OK_STATUS; >+ } >+ >+ } >+ >+ private static final String TAG_CONTEXT_STATE = "ContextState"; //$NON-NLS-1$ >+ >+ private static final long FLUSH_DELAY = 500; >+ >+ private static final String CHARSET = "UTF-8"; //$NON-NLS-1$ >+ >+ private final Map<String, ContextMemento> locked; >+ >+ private final Map<String, ContextMemento> pending; >+ >+ private final File location; >+ >+ private FlushJob flushJob; >+ >+ private boolean scheduled; >+ >+ public ContextMementoManager(File location) { >+ Assert.isNotNull(location); >+ this.location = location; >+ this.locked = new HashMap<String, ContextMemento>(); >+ this.pending = new HashMap<String, ContextMemento>(); >+ } >+ >+ public synchronized void flushPending() { >+ MultiStatus status = new MultiStatus(ContextUiPlugin.ID_PLUGIN, 0, >+ "Failed to save context workbench state", null); //$NON-NLS-1$ >+ for (ContextMemento memento : pending.values()) { >+ if (memento.isChanged()) { >+ IStatus result = write(memento); >+ status.add(result); >+ } >+ } >+ pending.clear(); >+ if (!status.isOK()) { >+ StatusHandler.log(status); >+ } >+ } >+ >+ public synchronized ContextMemento lock(IInteractionContext context) { >+ if (locked.containsKey(context.getHandleIdentifier())) { >+ throw new IllegalStateException(NLS.bind("Memento for \"{0}\" is already locked", //$NON-NLS-1$ >+ context.getHandleIdentifier())); >+ } >+ ContextMemento result = pending.remove(context.getHandleIdentifier()); >+ if (result == null) { >+ result = read(context); >+ } >+ // if reading failed or memento did not exist, start with an empty one >+ if (result == null) { >+ result = new ContextMemento(context, XMLMemento.createWriteRoot(TAG_CONTEXT_STATE)); >+ } >+ locked.put(context.getHandleIdentifier(), result); >+ return result; >+ } >+ >+ private ContextMemento read(IInteractionContext context) { >+ File file = getFile(context); >+ if (file.exists()) { >+ try { >+ BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), CHARSET)); >+ XMLMemento memento = XMLMemento.createReadRoot(reader); >+ return new ContextMemento(context, memento); >+ } catch (IOException e) { >+ StatusHandler.log(new Status(IStatus.ERROR, ContextUiPlugin.ID_PLUGIN, NLS.bind( >+ "Failed to read context memento from \"{0}\"", file.getAbsolutePath()), e)); //$NON-NLS-1$ >+ } catch (WorkbenchException e) { >+ StatusHandler.log(new Status(IStatus.ERROR, ContextUiPlugin.ID_PLUGIN, NLS.bind( >+ "Failed to read context memento from \"{0}\"", file.getAbsolutePath()), e)); //$NON-NLS-1$ >+ } >+ } >+ return null; >+ } >+ >+ private IStatus write(ContextMemento memento) { >+ File file = getFile(memento.getContext()); >+ if (!file.getParentFile().exists()) { >+ file.getParentFile().mkdirs(); >+ } >+ try { >+ BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), CHARSET)); >+ try { >+ (memento.getMemento()).save(writer); >+ } finally { >+ writer.close(); >+ } >+ } catch (IOException e) { >+ return new Status(IStatus.ERROR, ContextUiPlugin.ID_PLUGIN, NLS.bind( >+ "Failed to write context memento to \"{0}\"", file.getAbsolutePath()), e); //$NON-NLS-1$ >+ } >+ return Status.OK_STATUS; >+ } >+ >+ private File getFile(IInteractionContext context) { >+ return new File(location, TasksUtil.encode(context.getHandleIdentifier())); >+ } >+ >+ public synchronized void unlock(IInteractionContext context) { >+ ContextMemento result = locked.remove(context.getHandleIdentifier()); >+ if (result == null) { >+ StatusHandler.log(new Status(IStatus.ERROR, ContextUiPlugin.ID_PLUGIN, NLS.bind( >+ "Failed attempt to unlock memento \"{0}\"", context.getHandleIdentifier()))); //$NON-NLS-1$ >+ return; >+ } >+ pending.put(context.getHandleIdentifier(), result); >+ schedule(); >+ } >+ >+ private synchronized void schedule() { >+ if (!scheduled) { >+ if (flushJob == null) { >+ flushJob = new FlushJob(); >+ } >+ flushJob.schedule(FLUSH_DELAY); >+ } >+ } >+ >+} >Index: src/org/eclipse/mylyn/internal/context/ui/ContextMemento.java >=================================================================== >RCS file: src/org/eclipse/mylyn/internal/context/ui/ContextMemento.java >diff -N src/org/eclipse/mylyn/internal/context/ui/ContextMemento.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/internal/context/ui/ContextMemento.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,80 @@ >+/******************************************************************************* >+ * Copyright (c) 2004, 2008 Tasktop Technologies and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Tasktop Technologies - initial API and implementation >+ *******************************************************************************/ >+ >+package org.eclipse.mylyn.internal.context.ui; >+ >+import org.eclipse.core.runtime.Assert; >+import org.eclipse.mylyn.context.core.IInteractionContext; >+import org.eclipse.ui.IMemento; >+import org.eclipse.ui.XMLMemento; >+ >+/** >+ * Stores workspace specific settings for a context. >+ * >+ * @author Steffen Pingel >+ */ >+public class ContextMemento { >+ >+ private boolean changed; >+ >+ private final IInteractionContext context; >+ >+ private final XMLMemento memento; >+ >+ public ContextMemento(IInteractionContext context, XMLMemento memento) { >+ Assert.isNotNull(context); >+ Assert.isNotNull(memento); >+ this.context = context; >+ this.memento = memento; >+ } >+ >+ @Override >+ public boolean equals(Object obj) { >+ if (!(obj instanceof ContextMemento)) { >+ return false; >+ } >+ return context.equals(((ContextMemento) obj).context); >+ } >+ >+ public IInteractionContext getContext() { >+ return context; >+ } >+ >+ XMLMemento getMemento() { >+ return memento; >+ } >+ >+ public IMemento getMemento(String type) { >+ return memento.getChild(type); >+ } >+ >+ public IMemento createMemento(String type) { >+ return memento.createChild(type); >+ } >+ >+ @Override >+ public int hashCode() { >+ return context.hashCode(); >+ } >+ >+ public boolean isChanged() { >+ return changed; >+ } >+ >+ public void setChanged(boolean changed) { >+ this.changed = changed; >+ } >+ >+ public void removeMemento(String type) { >+ memento.createChild(type); >+ } >+ >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 226618
:
123033
|
123034
|
123040
|
123142
|
135417
|
152557
|
152558
|
153653
|
154288