|
Lines 14-19
Link Here
|
| 14 |
import org.eclipse.core.runtime.IProgressMonitor; |
14 |
import org.eclipse.core.runtime.IProgressMonitor; |
| 15 |
import org.eclipse.jface.resource.ImageDescriptor; |
15 |
import org.eclipse.jface.resource.ImageDescriptor; |
| 16 |
import org.eclipse.swt.graphics.Image; |
16 |
import org.eclipse.swt.graphics.Image; |
|
|
17 |
import org.eclipse.ui.IEditorInput; |
| 18 |
import org.eclipse.ui.IEditorPart; |
| 17 |
import org.eclipse.ui.ISaveablePart; |
19 |
import org.eclipse.ui.ISaveablePart; |
| 18 |
import org.eclipse.ui.IWorkbenchPart; |
20 |
import org.eclipse.ui.IWorkbenchPart; |
| 19 |
import org.eclipse.ui.IWorkbenchPart2; |
21 |
import org.eclipse.ui.IWorkbenchPart2; |
|
Lines 101-106
Link Here
|
| 101 |
* @see java.lang.Object#hashCode() |
103 |
* @see java.lang.Object#hashCode() |
| 102 |
*/ |
104 |
*/ |
| 103 |
public int hashCode() { |
105 |
public int hashCode() { |
|
|
106 |
if( part == null ) |
| 107 |
return 0; |
| 108 |
if( part instanceof IEditorPart ) { |
| 109 |
IEditorInput input = ((IEditorPart)part).getEditorInput(); |
| 110 |
if( input == null) |
| 111 |
return 0; |
| 112 |
return input.hashCode(); |
| 113 |
} |
| 104 |
return part.hashCode(); |
114 |
return part.hashCode(); |
| 105 |
} |
115 |
} |
| 106 |
|
116 |
|
|
Lines 118-126
Link Here
|
| 118 |
if (part == null) { |
128 |
if (part == null) { |
| 119 |
if (other.part != null) |
129 |
if (other.part != null) |
| 120 |
return false; |
130 |
return false; |
|
|
131 |
} else if( part instanceof IEditorPart ) { |
| 132 |
if( other.part != null && other.part instanceof IEditorPart ) { |
| 133 |
IEditorInput thisInput = ((IEditorPart)part).getEditorInput(); |
| 134 |
IEditorInput otherInput = ((IEditorPart)other.part).getEditorInput(); |
| 135 |
if( thisInput == null ) { |
| 136 |
if( otherInput != null ) |
| 137 |
return false; |
| 138 |
} else { |
| 139 |
return thisInput.equals(otherInput); |
| 140 |
} |
| 141 |
} |
| 121 |
} else if (!part.equals(other.part)) |
142 |
} else if (!part.equals(other.part)) |
| 122 |
return false; |
143 |
return false; |
| 123 |
return true; |
144 |
return true; |
| 124 |
} |
145 |
} |
| 125 |
|
|
|
| 126 |
} |
146 |
} |