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 110434 Details for
Bug 243744
[Dialogs] Adding content to "Compare with Other" dialog from Open Resource dialog
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
patch #2
patch-243744-3 (text/plain), 5.53 KB, created by
Aleksandra Wozniak
on 2008-08-20 07:06:22 EDT
(
hide
)
Description:
patch #2
Filename:
MIME Type:
Creator:
Aleksandra Wozniak
Created:
2008-08-20 07:06:22 EDT
Size:
5.53 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/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareMessages.java,v >retrieving revision 1.18 >diff -u -r1.18 CompareMessages.java >--- compare/org/eclipse/compare/internal/CompareMessages.java 19 Aug 2008 07:58:04 -0000 1.18 >+++ compare/org/eclipse/compare/internal/CompareMessages.java 20 Aug 2008 11:03:10 -0000 >@@ -120,6 +120,7 @@ > public static String CompareWithOther_clear; > public static String CompareWithOther_warning_two_way; > public static String CompareWithOther_info; >+ public static String CompareWithOther_openResourceButton; > > static { > NLS.initializeMessages(BUNDLE_NAME, CompareMessages.class); >Index: compare/org/eclipse/compare/internal/CompareWithOtherResourceDialog.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithOtherResourceDialog.java,v >retrieving revision 1.4 >diff -u -r1.4 CompareWithOtherResourceDialog.java >--- compare/org/eclipse/compare/internal/CompareWithOtherResourceDialog.java 20 Aug 2008 08:47:36 -0000 1.4 >+++ compare/org/eclipse/compare/internal/CompareWithOtherResourceDialog.java 20 Aug 2008 11:03:10 -0000 >@@ -45,11 +45,12 @@ > import org.eclipse.ui.forms.events.ExpansionAdapter; > import org.eclipse.ui.forms.events.ExpansionEvent; > import org.eclipse.ui.forms.widgets.ExpandableComposite; >+import org.eclipse.ui.internal.ide.dialogs.OpenResourceDialog; > import org.eclipse.ui.part.ResourceTransfer; > > /** > * This is a dialog that can invoke the compare editor on chosen files. >- * >+ * > * @since 3.4 > */ > public class CompareWithOtherResourceDialog extends TitleAreaDialog { >@@ -57,6 +58,7 @@ > private int CLEAR_RETURN_CODE = 150; // any number != 0 > private int MIN_WIDTH = 300; > private int MIN_HEIGHT = 175; >+ private int OPEN_RESOURCE_BUTTON_RETURN_CODE = 152; // any number != 0 > > private class FileTextDragListener implements DragSourceListener { > >@@ -159,6 +161,7 @@ > protected Group group; > protected Text fileText; > private IResource resource; >+ private Button openResourceButton; > > public InternalSection(Composite parent) { > createContents(parent); >@@ -172,6 +175,7 @@ > createGroup(parent); > createFileLabel(); > createFileCombo(); >+ createOpenResourceButton(group); > initDrag(); > initDrop(); > } >@@ -256,6 +260,36 @@ > final Label fileLabel = new Label(group, SWT.NONE); > fileLabel.setText(CompareMessages.CompareWithOther_fileLabel); > } >+ >+ protected void createOpenResourceButton(Composite parent) { >+ openResourceButton = createButton(parent, >+ OPEN_RESOURCE_BUTTON_RETURN_CODE, CompareMessages.CompareWithOther_openResourceButton, false); >+ openResourceButton.addSelectionListener(new SelectionListener() { >+ public void widgetDefaultSelected(SelectionEvent e) { >+ widgetSelected(e); >+ } >+ public void widgetSelected(SelectionEvent e) { >+ setResource(getResourceFromDialog()); >+ } >+ }); >+ } >+ >+ private IResource getResourceFromDialog() { >+ IResource r = null; >+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); >+ OpenResourceDialog dialog = new OpenResourceDialog(getShell(), >+ root, IResource.FILE); >+ int returnCode = dialog.open(); >+ >+ if (returnCode != IDialogConstants.OK_ID) >+ return null; >+ >+ Object[] result = dialog.getResult(); >+ if (result.length > 0) >+ r = (IResource) result[0]; >+ >+ return r; >+ } > } > > private class InternalGroup extends InternalSection { >@@ -286,6 +320,7 @@ > createGroup(parent); > createFileLabel(); > createFileCombo(); >+ createOpenResourceButton(group); > createClearButton(group); > initDrag(); > initDrop(); >@@ -335,7 +370,7 @@ > > /** > * Creates the dialog. >- * >+ * > * @param shell > * a shell > * @param selection >@@ -351,7 +386,7 @@ > > /* > * (non-Javadoc) >- * >+ * > * @see > * org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets > * .Composite) >@@ -387,7 +422,7 @@ > > /* > * (non-Javadoc) >- * >+ * > * @see > * org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse > * .swt.widgets.Composite) >@@ -462,7 +497,7 @@ > * 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() { >Index: compare/org/eclipse/compare/internal/CompareMessages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareMessages.properties,v >retrieving revision 1.29 >diff -u -r1.29 CompareMessages.properties >--- compare/org/eclipse/compare/internal/CompareMessages.properties 19 Aug 2008 07:58:04 -0000 1.29 >+++ compare/org/eclipse/compare/internal/CompareMessages.properties 20 Aug 2008 11:03:10 -0000 >@@ -132,3 +132,4 @@ > CompareWithOther_warning_two_way=Ancestor is not a valid resource. Two-way compare will be performed. > CompareWithOther_clear=Clear > CompareWithOther_info=Drag files from a view or between dialog's fields. >+CompareWithOther_openResourceButton=Browse...
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 243744
:
109662
|
110434
|
111179
|
117987