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 37268 Details for
Bug 133989
React to rename of ISaveableModel
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
patch against org.eclipse.compare
patch-112225-Andre.txt (text/plain), 5.55 KB, created by
Boris Bokowski
on 2006-03-30 01:12:06 EST
(
hide
)
Description:
patch against org.eclipse.compare
Filename:
MIME Type:
Creator:
Boris Bokowski
Created:
2006-03-30 01:12:06 EST
Size:
5.55 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.compare >Index: compare/org/eclipse/compare/internal/CompareEditor.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditor.java,v >retrieving revision 1.31 >diff -u -r1.31 CompareEditor.java >--- compare/org/eclipse/compare/internal/CompareEditor.java 28 Mar 2006 14:50:59 -0000 1.31 >+++ compare/org/eclipse/compare/internal/CompareEditor.java 29 Mar 2006 22:53:44 -0000 >@@ -36,7 +36,7 @@ > * A CompareEditor takes a ICompareEditorInput as input. > * Most functionality is delegated to the ICompareEditorInput. > */ >-public class CompareEditor extends EditorPart implements IReusableEditor, ISaveableModelSource, ISaveableModel { >+public class CompareEditor extends EditorPart implements IReusableEditor, ISaveablesSource { > > /** > * Internal property change listener for handling changes in the editor's input. >@@ -59,6 +59,8 @@ > private Control fControl; > /** the outline page */ > private CompareOutlinePage fOutlinePage; >+ >+ private CompareSaveable fSaveable; > /** enable outline */ > > >@@ -258,11 +260,11 @@ > */ > public boolean isDirty() { > IEditorInput input= getEditorInput(); >- if (input instanceof ISaveableModelSource) { >- ISaveableModelSource sms = (ISaveableModelSource) input; >- ISaveableModel[] models = sms.getModels(); >+ if (input instanceof ISaveablesSource) { >+ ISaveablesSource sms = (ISaveablesSource) input; >+ Saveable[] models = sms.getSaveables(); > for (int i = 0; i < models.length; i++) { >- ISaveableModel model = models[i]; >+ Saveable model = models[i]; > if (model.isDirty()) > return true; > } >@@ -280,48 +282,65 @@ > } > > /* (non-Javadoc) >- * @see org.eclipse.ui.ISaveableModelSource#getModels() >+ * @see org.eclipse.ui.ISaveablesSource#getModels() > */ >- public ISaveableModel[] getModels() { >+ public Saveable[] getSaveables() { > IEditorInput input= getEditorInput(); >- if (input instanceof ISaveableModelSource) { >- ISaveableModelSource source = (ISaveableModelSource) input; >- return source.getModels(); >+ if (input instanceof ISaveablesSource) { >+ ISaveablesSource source = (ISaveablesSource) input; >+ return source.getSaveables(); > } >- return new ISaveableModel[] { this }; >+ return new Saveable[] { getSaveable() }; > } > >- /* (non-Javadoc) >- * @see org.eclipse.ui.ISaveableModelSource#getActiveModels() >- */ >- public ISaveableModel[] getActiveModels() { >- IEditorInput input= getEditorInput(); >- if (input instanceof ISaveableModelSource) { >- ISaveableModelSource source = (ISaveableModelSource) input; >- return source.getActiveModels(); >+ private Saveable getSaveable() { >+ if (fSaveable == null) { >+ fSaveable = new CompareSaveable(); > } >- return new ISaveableModel[] { this }; >+ return fSaveable; > } > > /* (non-Javadoc) >- * @see org.eclipse.ui.ISaveableModel#getName() >+ * @see org.eclipse.ui.ISaveablesSource#getActiveModels() > */ >- public String getName() { >- return getPartName(); >+ public Saveable[] getActiveSaveables() { >+ IEditorInput input= getEditorInput(); >+ if (input instanceof ISaveablesSource) { >+ ISaveablesSource source = (ISaveablesSource) input; >+ return source.getActiveSaveables(); >+ } >+ return new Saveable[] { getSaveable() }; > } >+ >+ private class CompareSaveable extends Saveable { > >- /* (non-Javadoc) >- * @see org.eclipse.ui.ISaveableModel#getToolTipText() >- */ >- public String getToolTipText() { >- return getTitleToolTip(); >- } >+ public String getName() { >+ return CompareEditor.this.getPartName(); >+ } > >- /* (non-Javadoc) >- * @see org.eclipse.ui.ISaveableModel#getImageDescriptor() >- */ >- public ImageDescriptor getImageDescriptor() { >- return ImageDescriptor.createFromImage(getTitleImage()); >+ public String getToolTipText() { >+ return CompareEditor.this.getTitleToolTip(); >+ } >+ >+ public ImageDescriptor getImageDescriptor() { >+ return ImageDescriptor.createFromImage(CompareEditor.this.getTitleImage()); >+ } >+ >+ public void doSave(IProgressMonitor monitor) throws CoreException { >+ CompareEditor.this.doSave(monitor); >+ } >+ >+ public boolean isDirty() { >+ return CompareEditor.this.isDirty(); >+ } >+ >+ public boolean equals(Object object) { >+ return object == this; >+ } >+ >+ public int hashCode() { >+ return CompareEditor.this.hashCode(); >+ } > } > } > >Index: compare/org/eclipse/compare/CompareEditorInput.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java,v >retrieving revision 1.58 >diff -u -r1.58 CompareEditorInput.java >--- compare/org/eclipse/compare/CompareEditorInput.java 28 Mar 2006 14:50:59 -0000 1.58 >+++ compare/org/eclipse/compare/CompareEditorInput.java 29 Mar 2006 22:53:44 -0000 >@@ -88,7 +88,7 @@ > * If a subclass cannot use the <code>DiffTreeViewer</code> which is installed by default in the > * top left pane, method <code>createDiffViewer</code> can be overridden. > * <p> >- * If subclasses of this class implement {@link ISaveableModelSource}, the compare editor will >+ * If subclasses of this class implement {@link ISaveablesSource}, the compare editor will > * pass these models through to the workbench. The editor will still show the dirty indicator > * if one of these underlying models is dirty. It is the reponsibility of subclasses that > * implement this interface to call {@link #setDirty(boolean)} when the dirty state of
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 133989
: 37268