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 107452 Details for
Bug 239959
Adding content to "Compare with other resource" dialog by drag&dropping
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Suggested modifications applied.
patch-239959-1 (text/plain), 25.34 KB, created by
Aleksandra Wozniak
on 2008-07-15 08:17:40 EDT
(
hide
)
Description:
Suggested modifications applied.
Filename:
MIME Type:
Creator:
Aleksandra Wozniak
Created:
2008-07-15 08:17:40 EDT
Size:
25.34 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.compare >Index: compare/org/eclipse/compare/internal/CompareMessages.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareMessages.java,v >retrieving revision 1.17.4.1 >diff -u -r1.17.4.1 CompareMessages.java >--- compare/org/eclipse/compare/internal/CompareMessages.java 10 Jul 2008 10:57:09 -0000 1.17.4.1 >+++ compare/org/eclipse/compare/internal/CompareMessages.java 15 Jul 2008 12:12:28 -0000 >@@ -118,6 +118,9 @@ > public static String CompareWithOther_error_empty; > public static String CompareWithOther_clearAll; > public static String CompareWithOther_clear; >+ public static String CompareWithOther_clipboard; >+ public static String CompareWithOther_tmp_file_path; >+ public static String CompareWithOther_clipboard_files; > > static { > NLS.initializeMessages(BUNDLE_NAME, CompareMessages.class); >Index: compare/org/eclipse/compare/internal/CompareWithOtherResourceDialog.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.compare/compare/org/eclipse/compare/internal/Attic/CompareWithOtherResourceDialog.java,v >retrieving revision 1.1.2.1 >diff -u -r1.1.2.1 CompareWithOtherResourceDialog.java >--- compare/org/eclipse/compare/internal/CompareWithOtherResourceDialog.java 10 Jul 2008 10:57:09 -0000 1.1.2.1 >+++ compare/org/eclipse/compare/internal/CompareWithOtherResourceDialog.java 15 Jul 2008 12:12:28 -0000 >@@ -18,6 +18,7 @@ > import org.eclipse.jface.dialogs.IMessageProvider; > import org.eclipse.jface.dialogs.TitleAreaDialog; > import org.eclipse.jface.viewers.ISelection; >+import org.eclipse.jface.viewers.StructuredSelection; > import org.eclipse.swt.SWT; > import org.eclipse.swt.dnd.DND; > import org.eclipse.swt.dnd.DragSource; >@@ -55,7 +56,7 @@ > */ > public class CompareWithOtherResourceDialog extends TitleAreaDialog { > >- public int CLEAR_RETURN_CODE = 150; // any number != 0 >+ private int CLEAR_RETURN_CODE = 150; // any number != 0 > > private class FileTextDragListener implements DragSourceListener { > >@@ -93,102 +94,113 @@ > } > > public void dragEnter(DropTargetEvent event) { >+ > if (event.detail == DND.DROP_DEFAULT) { > if ((event.operations & DND.DROP_COPY) != 0) > event.detail = DND.DROP_COPY; > else > event.detail = DND.DROP_NONE; > } >+ > for (int i = 0; i < event.dataTypes.length; i++) { > if (resourceTransfer.isSupportedType(event.dataTypes[i])) { > event.currentDataType = event.dataTypes[i]; > if (event.detail != DND.DROP_COPY) > event.detail = DND.DROP_NONE; >+ break; > } >- break; > } > } > > public void dragLeave(DropTargetEvent event) { >+ // intentionally empty > } > > public void dragOperationChanged(DropTargetEvent event) { >+ > if (event.detail == DND.DROP_DEFAULT) { > if ((event.operations & DND.DROP_COPY) != 0) > event.detail = DND.DROP_COPY; > else > event.detail = DND.DROP_NONE; >- } >- if (resourceTransfer.isSupportedType(event.currentDataType)) { >+ } else if (resourceTransfer.isSupportedType(event.currentDataType)) { > if (event.detail != DND.DROP_COPY) > event.detail = DND.DROP_NONE; > } > } > > public void dragOver(DropTargetEvent event) { >+ // intentionally empty > } > > public void drop(DropTargetEvent event) { >+ > if (textTransfer.isSupportedType(event.currentDataType)) { > String txt = (String) event.data; >- section.fileText.setText(txt); > section.setResource(ResourcesPlugin.getWorkspace().getRoot() > .findMember(txt)); >- } >- if (resourceTransfer.isSupportedType(event.currentDataType)) { >+ } else if (resourceTransfer.isSupportedType(event.currentDataType)) { > IResource[] files = (IResource[]) event.data; > section.setResource(files[0]); >- section.fileText.setText(section.getResource().getFullPath() >- .toString()); > } >+ >+ updateErrorInfo(); > } > > public void dropAccept(DropTargetEvent event) { >+ // intentionally empty > } > > } > > private abstract class InternalSection { > >- protected Text fileText; >- protected IResource resource; >- protected IResource[] files; >- protected String fileString = null; > protected Group group; >- protected Button clearButton; >+ private Text fileText; >+ private IResource resource; >+ private Button clearButton; > > public InternalSection(Composite parent) { > createContents(parent); > } > > public InternalSection() { >+ // not to instantiate > } > > public void createContents(Composite parent) { >+ createGroup(parent); >+ createFileLabel(); >+ createFileCombo(); >+ createClearButton(group); >+ initDrag(); >+ initDrop(); > } > > public IResource getResource() { >- if (resource == null) { >- if (fileString != null) { //$NON-NLS-1$ >- IWorkspaceRoot root = ResourcesPlugin.getWorkspace() >- .getRoot(); >- resource = root.findMember(fileString); >- if (resource instanceof IWorkspaceRoot) >- return null; >- return resource; >- } >- } > return resource; > } > > public void setResource(IResource resource) { > this.resource = resource; >- fileText.setText(resource.getFullPath().toString()); >+ String txt = resource.getFullPath().toString(); >+ fileText.setText(txt); >+ } >+ >+ public void setResource(String s) { >+ IResource tmp = ResourcesPlugin.getWorkspace().getRoot() >+ .findMember(s); >+ if (tmp instanceof IWorkspaceRoot) >+ resource = null; >+ else >+ resource = tmp; >+ > } > > protected void clearResource() { > resource = null; > fileText.setText(""); //$NON-NLS-1$ >+ updateErrorInfo(); > } > > protected void initDrag() { >@@ -203,48 +215,42 @@ > protected void initDrop() { > DropTarget target = new DropTarget(fileText, DND.DROP_MOVE > | DND.DROP_COPY | DND.DROP_DEFAULT); >- final TextTransfer textTransfer = TextTransfer.getInstance(); >- final ResourceTransfer resourceTransfer = ResourceTransfer >- .getInstance(); >- Transfer[] types = new Transfer[] { textTransfer, resourceTransfer }; >+ Transfer[] types = new Transfer[] { TextTransfer.getInstance(), >+ ResourceTransfer.getInstance() }; > target.setTransfer(types); > target.addDropListener(new FileTextDropListener(this)); > } > > protected void createGroup(Composite parent) { >- GridLayout layout = new GridLayout(); >- layout.numColumns = 3; > group = new Group(parent, SWT.NONE); >- group.setLayout(layout); >- GridData gridData = new GridData(); >- gridData.grabExcessHorizontalSpace = true; >- gridData.grabExcessVerticalSpace = true; >- group.setLayoutData(gridData); >+ group.setLayout(new GridLayout(3, false)); >+ group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); > } > >- protected void createFileText() { >- fileText = new Text(group, SWT.SINGLE | SWT.BORDER); >- fileText.addModifyListener(new ModifyListener() { >+ protected void createFileCombo() { >+ fileText = new Text(group, SWT.BORDER); >+ fileText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, >+ false)); > >+ fileText.addModifyListener(new ModifyListener() { > public void modifyText(ModifyEvent e) { >- if (files != null) >- resource = files[0]; >- fileString = fileText.getText(); >- if (fileString == "") //$NON-NLS-1$ >- resource = null; >- else >- resource = getResource(); >- if (okButton != null) >- okButton.setEnabled(comparePossible()); >+ setResource(fileText.getText()); > updateErrorInfo(); > } >- > }); > >- GridData textData = new GridData(); >- textData.grabExcessHorizontalSpace = true; >- textData.horizontalAlignment = SWT.FILL; >- fileText.setLayoutData(textData); >+ fileText.addSelectionListener(new SelectionListener() { >+ >+ public void widgetDefaultSelected(SelectionEvent e) { >+ widgetSelected(e); >+ } >+ >+ public void widgetSelected(SelectionEvent e) { >+ setResource(fileText.getText()); >+ updateErrorInfo(); >+ } >+ >+ }); > } > > protected void createFileLabel() { >@@ -256,7 +262,6 @@ > clearButton = createButton(parent, CLEAR_RETURN_CODE, > CompareMessages.CompareWithOther_clear, false); > clearButton.addSelectionListener(new SelectionListener() { >- > public void widgetDefaultSelected(SelectionEvent e) { > widgetSelected(e); > } >@@ -264,32 +269,16 @@ > public void widgetSelected(SelectionEvent e) { > clearResource(); > } >- > }); > } >- >- abstract public void setLayoutData(GridData layoutData); >- >- abstract public void setText(String text); >- > } > > private class InternalGroup extends InternalSection { > > public InternalGroup(Composite parent) { >- super(); > createContents(parent); > } > >- public void createContents(Composite parent) { >- createGroup(parent); >- createFileLabel(); >- createFileText(); >- createClearButton(group); >- initDrag(); >- initDrop(); >- } >- > public void setText(String text) { > group.setText(text); > } >@@ -304,30 +293,20 @@ > private ExpandableComposite expandable; > > public InternalExpandable(Composite parent) { >- super(); > createContents(parent); > } > >- public void createContents(Composite parent) { >- >+ public void createGroup(Composite parent) { > final Composite p = parent; >- > expandable = new ExpandableComposite(parent, SWT.NONE, > ExpandableComposite.TREE_NODE | ExpandableComposite.TWISTIE); >- >- createGroup(expandable); >+ super.createGroup(expandable); > expandable.setClient(group); > expandable.addExpansionListener(new ExpansionAdapter() { > public void expansionStateChanged(ExpansionEvent e) { > p.getShell().pack(); > } > }); >- >- createFileLabel(); >- createFileText(); >- createClearButton(group); >- initDrag(); >- initDrop(); > } > > public void setText(String text) { >@@ -338,10 +317,9 @@ > public void setLayoutData(GridData layoutData) { > expandable.setLayoutData(layoutData); > } >- > } > >- private Button okButton, cancelButton, clearAllButton; >+ private Button okButton, clearAllButton; > private InternalGroup rightPanel, leftPanel; > private InternalExpandable ancestorPanel; > private ISelection fselection; >@@ -372,10 +350,7 @@ > protected Control createDialogArea(Composite parent) { > > Composite mainPanel = new Composite(parent, SWT.NULL); >- GridLayout layout = new GridLayout(); >- layout.numColumns = 2; >- layout.makeColumnsEqualWidth = true; >- mainPanel.setLayout(layout); >+ mainPanel.setLayout(new GridLayout(2, true)); > mainPanel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); > > ancestorPanel = new InternalExpandable(mainPanel); >@@ -386,13 +361,11 @@ > > rightPanel = new InternalGroup(mainPanel); > rightPanel.setText(CompareMessages.CompareWithOther_rightPanel); >- GridData rightGD = new GridData(SWT.FILL, SWT.FILL, true, true); >- rightPanel.setLayoutData(rightGD); >+ rightPanel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); > > leftPanel = new InternalGroup(mainPanel); > leftPanel.setText(CompareMessages.CompareWithOther_leftPanel); >- GridData leftGD = new GridData(SWT.FILL, SWT.FILL, true, true); >- leftPanel.setLayoutData(leftGD); >+ leftPanel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); > > setSelection(fselection); > getShell().setText(CompareMessages.CompareWithOther_dialogTitle); >@@ -409,50 +382,13 @@ > * .swt.widgets.Composite) > */ > protected void createButtonsForButtonBar(Composite parent) { >- okButton = createButton(parent, OK, IDialogConstants.OK_LABEL, false); >- okButton.addSelectionListener(new SelectionListener() { >- >- public void widgetDefaultSelected(SelectionEvent e) { >- widgetSelected(e); >- } >- >- public void widgetSelected(SelectionEvent e) { >- >- IResource[] resources; >- >- IResource rightResource = rightPanel.getResource(); >- IResource leftResource = leftPanel.getResource(); >- IResource ancestorResource = ancestorPanel.getResource(); >- if (ancestorResource == null) >- resources = new IResource[] { leftResource, rightResource }; >- else >- resources = new IResource[] { ancestorResource, >- leftResource, rightResource }; >- >- if (CompareAction.isEnabled(resources)) >- CompareAction.run(resources); >- } > >- }); >- okButton.setEnabled(comparePossible()); >- >- cancelButton = createButton(parent, CANCEL, >- IDialogConstants.CANCEL_LABEL, true); >- cancelButton.addSelectionListener(new SelectionListener() { >- >- public void widgetDefaultSelected(SelectionEvent e) { >- widgetSelected(e); >- } >- >- public void widgetSelected(SelectionEvent e) { >- } >- >- }); >+ super.createButtonsForButtonBar(parent); >+ okButton = getButton(IDialogConstants.OK_ID); > > clearAllButton = createButton(parent, CLEAR_RETURN_CODE, > CompareMessages.CompareWithOther_clearAll, false); > clearAllButton.addSelectionListener(new SelectionListener() { >- > public void widgetDefaultSelected(SelectionEvent e) { > widgetSelected(e); > } >@@ -462,8 +398,9 @@ > rightPanel.clearResource(); > ancestorPanel.clearResource(); > } >- > }); >+ >+ updateErrorInfo(); > } > > private void setSelection(ISelection selection) { >@@ -489,26 +426,55 @@ > > private boolean comparePossible() { > IResource[] resources; >- if (ancestorPanel.resource == null) >- resources = new IResource[] { leftPanel.resource, >- rightPanel.resource }; >+ if (ancestorPanel.getResource() == null) >+ resources = new IResource[] { leftPanel.getResource(), >+ rightPanel.getResource() }; > else >- resources = new IResource[] { ancestorPanel.resource, >- leftPanel.resource, rightPanel.resource }; >+ resources = new IResource[] { ancestorPanel.getResource(), >+ leftPanel.getResource(), rightPanel.getResource() }; > > ResourceCompareInput r = new ResourceCompareInput( > new CompareConfiguration()); >- return r.isEnabled(resources); >+ return r.isEnabled(new StructuredSelection(resources)); > } > > private void updateErrorInfo() { >- if (leftPanel.resource == null || rightPanel.resource == null) >- setMessage(CompareMessages.CompareWithOther_error_empty, >- IMessageProvider.ERROR); >- else if (!comparePossible()) >- setMessage(CompareMessages.CompareWithOther_error_not_comparable, >- IMessageProvider.ERROR); >+ if (okButton != null) { >+ if (leftPanel.getResource() == null >+ || rightPanel.getResource() == null) { >+ setMessage(CompareMessages.CompareWithOther_error_empty, >+ IMessageProvider.ERROR); >+ okButton.setEnabled(false); >+ } else if (!comparePossible()) { >+ setMessage( >+ CompareMessages.CompareWithOther_error_not_comparable, >+ IMessageProvider.ERROR); >+ okButton.setEnabled(false); >+ } else { >+ setMessage(null); >+ okButton.setEnabled(true); >+ } >+ } >+ } >+ >+ /** >+ * Returns table with selected resources. If any resource wasn't chosen in >+ * the ancestor panel, table has only two elements -- resources chosen in >+ * left and right panel. In the other case table contains all three >+ * resources. >+ * >+ * @return table with selected resources >+ */ >+ public IResource[] getResult() { >+ IResource[] resources; >+ IResource rightResource = rightPanel.getResource(); >+ IResource leftResource = leftPanel.getResource(); >+ IResource ancestorResource = ancestorPanel.getResource(); >+ if (ancestorResource == null) >+ resources = new IResource[] { leftResource, rightResource }; > else >- setMessage(null); >+ resources = new IResource[] { ancestorResource, leftResource, >+ rightResource }; >+ return resources; > } > } >Index: compare/org/eclipse/compare/internal/CompareWithOtherResourceAction.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.compare/compare/org/eclipse/compare/internal/Attic/CompareWithOtherResourceAction.java,v >retrieving revision 1.1.2.1 >diff -u -r1.1.2.1 CompareWithOtherResourceAction.java >--- compare/org/eclipse/compare/internal/CompareWithOtherResourceAction.java 10 Jul 2008 10:57:09 -0000 1.1.2.1 >+++ compare/org/eclipse/compare/internal/CompareWithOtherResourceAction.java 15 Jul 2008 12:12:28 -0000 >@@ -10,8 +10,11 @@ > *******************************************************************************/ > package org.eclipse.compare.internal; > >+import org.eclipse.core.resources.IResource; > import org.eclipse.jface.action.IAction; >+import org.eclipse.jface.dialogs.IDialogConstants; > import org.eclipse.jface.viewers.ISelection; >+import org.eclipse.jface.viewers.StructuredSelection; > import org.eclipse.swt.widgets.Shell; > import org.eclipse.ui.IObjectActionDelegate; > import org.eclipse.ui.IWorkbenchPart; >@@ -19,6 +22,7 @@ > > /** > * The "Compare with other resource" action >+ * > * @since 3.4 > */ > public class CompareWithOtherResourceAction implements IObjectActionDelegate { >@@ -26,17 +30,28 @@ > Shell shell; > CompareWithOtherResourceDialog dialog; > private ISelection fselection; >+ private IWorkbenchPart fWorkbenchPart; > > public CompareWithOtherResourceAction() { > shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); > } > > public void setActivePart(IAction action, IWorkbenchPart targetPart) { >+ fWorkbenchPart = targetPart; > } > > public void run(IAction action) { > dialog = new CompareWithOtherResourceDialog(shell, fselection); >- dialog.open(); >+ int returnCode = dialog.open(); >+ >+ if (returnCode == IDialogConstants.OK_ID) { >+ IResource[] resources = dialog.getResult(); >+ StructuredSelection ss = new StructuredSelection(resources); >+ CompareAction ca = new CompareAction(); >+ ca.setActivePart(null, fWorkbenchPart); >+ if (ca.isEnabled(ss)) >+ ca.run(ss); >+ } > } > > public void selectionChanged(IAction action, ISelection selection) { >Index: compare/org/eclipse/compare/internal/CompareMessages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareMessages.properties,v >retrieving revision 1.27.4.1 >diff -u -r1.27.4.1 CompareMessages.properties >--- compare/org/eclipse/compare/internal/CompareMessages.properties 10 Jul 2008 10:57:09 -0000 1.27.4.1 >+++ compare/org/eclipse/compare/internal/CompareMessages.properties 15 Jul 2008 12:12:28 -0000 >@@ -127,6 +127,9 @@ > CompareWithOther_dialogTitle=Compare with Other Resource... > CompareWithOther_dialogMessage=Select resources to compare > CompareWithOther_error_not_comparable=Selected resources are not comparable. >-CompareWithOther_error_empty=Both left and right panel must not be empty. >+CompareWithOther_error_empty=Both left and right panel must contain a valid path to resource from workspace. > CompareWithOther_clearAll=Clear All > CompareWithOther_clear=Clear >+CompareWithOther_clipboard=From clipboard >+CompareWithOther_tmp_file_path=clipboard >+CompareWithOther_clipboard_files=ClipboardTmpFiles >\ No newline at end of file >Index: compare/org/eclipse/compare/internal/CompareAction.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareAction.java,v >retrieving revision 1.20.8.1 >diff -u -r1.20.8.1 CompareAction.java >--- compare/org/eclipse/compare/internal/CompareAction.java 10 Jul 2008 10:57:09 -0000 1.20.8.1 >+++ compare/org/eclipse/compare/internal/CompareAction.java 15 Jul 2008 12:12:28 -0000 >@@ -19,7 +19,6 @@ > import org.eclipse.ui.IWorkbenchPart; > import org.eclipse.compare.CompareConfiguration; > import org.eclipse.compare.CompareUI; >-import org.eclipse.core.resources.IResource; > > > /* >@@ -27,31 +26,17 @@ > */ > public class CompareAction extends BaseCompareAction implements IObjectActionDelegate { > >- private static ResourceCompareInput fInput; >- private static IWorkbenchPage fWorkbenchPage; >+ private ResourceCompareInput fInput; >+ private IWorkbenchPage fWorkbenchPage; >+ > > public void run(ISelection selection) { > if (fInput != null) { > // Pass the shell so setSelection can prompt the user for which > // resource should be the ancestor >- boolean ok = fInput.setSelection(selection, fWorkbenchPage >- .getWorkbenchWindow().getShell()); >- if (!ok) >- return; >- fInput.initializeCompareConfiguration(); >- CompareUI.openCompareEditorOnPage(fInput, fWorkbenchPage); >- fInput = null; // don't reuse this input! >- } >- } >- >- public static void run(IResource[] resources) { >- fWorkbenchPage = CompareUIPlugin.getActiveWorkbench() >- .getActiveWorkbenchWindow().getActivePage(); >- if (fInput != null) { >- boolean ok = fInput.setSelection(resources, fWorkbenchPage >- .getWorkbenchWindow().getShell()); >- if (!ok) >- return; >+ boolean ok = fInput.setSelection(selection, >+ fWorkbenchPage.getWorkbenchWindow().getShell()); >+ if (!ok) return; > fInput.initializeCompareConfiguration(); > CompareUI.openCompareEditorOnPage(fInput, fWorkbenchPage); > fInput= null; // don't reuse this input! >@@ -73,16 +58,6 @@ > return fInput.isEnabled(selection); > } > >- public static boolean isEnabled(IResource[] resources) { >- if (fInput == null) { >- CompareConfiguration cc = new CompareConfiguration(); >- cc.setProperty(CompareEditor.CONFIRM_SAVE_PROPERTY, new Boolean( >- false)); >- fInput = new ResourceCompareInput(cc); >- } >- return fInput.isEnabled(resources); >- } >- > public void setActivePart(IAction action, IWorkbenchPart targetPart) { > fWorkbenchPage= targetPart.getSite().getPage(); > } >Index: compare/org/eclipse/compare/internal/ResourceCompareInput.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.compare/compare/org/eclipse/compare/internal/ResourceCompareInput.java,v >retrieving revision 1.38.8.1 >diff -u -r1.38.8.1 ResourceCompareInput.java >--- compare/org/eclipse/compare/internal/ResourceCompareInput.java 10 Jul 2008 10:57:09 -0000 1.38.8.1 >+++ compare/org/eclipse/compare/internal/ResourceCompareInput.java 15 Jul 2008 12:12:28 -0000 >@@ -201,14 +201,11 @@ > // to use as the ancestor. Returns false if the user cancels the prompt, > // true otherwise. > boolean setSelection(ISelection s, Shell shell) { >- IResource[] selection = Utilities.getResources(s); >- return setSelection(selection, shell); >- } >- >- boolean setSelection(IResource[] selection, Shell shell) { >- >- fThreeWay = selection.length == 3; >+ >+ IResource[] selection= Utilities.getResources(s); > >+ fThreeWay= selection.length == 3; >+ > if (fThreeWay) { > SelectAncestorDialog dialog = > new SelectAncestorDialog(shell, selection); >@@ -236,26 +233,21 @@ > * Returns true if compare can be executed for the given selection. > */ > public boolean isEnabled(ISelection s) { >- >- IResource[] selection = Utilities.getResources(s); >- return isEnabled(selection); >- } >- >- public boolean isEnabled(IResource[] resources) { >- if (resources.length < 2 || resources.length > 3) >+ >+ IResource[] selection= Utilities.getResources(s); >+ if (selection.length < 2 || selection.length > 3) > return false; > >- boolean threeWay= resources.length == 3; >+ boolean threeWay= selection.length == 3; > >- if (threeWay) { >+ if (threeWay) > // It only makes sense if they're all mutually comparable. > // If not, the user should compare two of them. >- return comparable(resources[0], resources[1]) >- && comparable(resources[0], resources[2]) >- && comparable(resources[1], resources[2]); >- } >- >- return comparable(resources[0], resources[1]); >+ return comparable(selection[0], selection[1]) >+ && comparable(selection[0], selection[2]) >+ && comparable(selection[1], selection[2]); >+ >+ return comparable(selection[0], selection[1]); > } > > /** >Index: plugin.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.compare/plugin.properties,v >retrieving revision 1.91.2.1 >diff -u -r1.91.2.1 plugin.properties >--- plugin.properties 10 Jul 2008 10:57:09 -0000 1.91.2.1 >+++ plugin.properties 15 Jul 2008 12:12:28 -0000 >@@ -83,9 +83,15 @@ > CompareWithEachOtherAction.label= &Each Other > CompareWithEachOtherAction.tooltip= Compare the Selected Resources > >+<<<<<<< plugin.properties >+CompareWithOtherResource.label= &Other Resource... >+CompareWithOtherResource.tooltip= Open the 'Compare With' Dialog >+ >+======= > CompareWithOtherResource.label= &Other Resource > CompareWithOtherResource.tooltip= Open the 'Compare With' Dialog > >+>>>>>>> 1.91.2.1 > CompareWithHistoryAction.label= &Local History... > CompareWithHistoryAction.tooltip= Compare the Selected Resource with Local History > >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.compare/plugin.xml,v >retrieving revision 1.65.6.1 >diff -u -r1.65.6.1 plugin.xml >--- plugin.xml 10 Jul 2008 10:57:09 -0000 1.65.6.1 >+++ plugin.xml 15 Jul 2008 12:12:28 -0000 >@@ -203,7 +203,7 @@ > </action> > <action > class="org.eclipse.compare.internal.CompareWithOtherResourceAction" >- enablesFor="1" >+ enablesFor="+" > id="compareWithOtherResource" > label="%CompareWithOtherResource.label" > menubarPath="compareWithMenu/compareWithGroup"
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 239959
:
106813
|
106961
|
107452
|
107717
|
107944
|
108052
|
108194
|
108533
|
108951