View | Details | Raw Unified | Return to bug 261716 | Differences between
and this patch

Collapse All | Expand All

(-)plugin.xml (+7 lines)
Lines 348-352 Link Here
348
            class="org.eclipse.compare.internal.ComparePreferenceInitializer">
348
            class="org.eclipse.compare.internal.ComparePreferenceInitializer">
349
      </initializer>
349
      </initializer>
350
   </extension>
350
   </extension>
351
   <extension
352
         point="org.eclipse.ui.workbench.texteditor.outOfSyncHandler">
353
      <handler
354
            answer="Compare file system and editor versions"
355
            class="org.eclipse.compare.CompareOutOfSyncHandler">
356
      </handler>
357
   </extension>
351
358
352
</plugin>
359
</plugin>
(-)META-INF/MANIFEST.MF (-1 / +2 lines)
Lines 23-29 Link Here
23
 org.eclipse.core.expressions;bundle-version="[3.2.0,4.0.0)",
23
 org.eclipse.core.expressions;bundle-version="[3.2.0,4.0.0)",
24
 org.eclipse.ui.editors;bundle-version="[3.3.0,4.0.0)",
24
 org.eclipse.ui.editors;bundle-version="[3.3.0,4.0.0)",
25
 org.eclipse.ui.forms;bundle-version="[3.2.0,4.0.0)",
25
 org.eclipse.ui.forms;bundle-version="[3.2.0,4.0.0)",
26
 org.eclipse.compare.core;bundle-version="[3.5.0,4.0.0)";visibility:=reexport
26
 org.eclipse.compare.core;bundle-version="[3.5.0,4.0.0)";visibility:=reexport,
27
 org.eclipse.core.filesystem;bundle-version="1.2.0"
27
Bundle-ActivationPolicy: lazy
28
Bundle-ActivationPolicy: lazy
28
Import-Package: com.ibm.icu.util,
29
Import-Package: com.ibm.icu.util,
29
 com.ibm.icu.text
30
 com.ibm.icu.text
(-)compare/org/eclipse/compare/CompareOutOfSyncHandler.java (+55 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2007, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Renato Silva - initial prototype  
10
 *                    (http://bugs.eclipse.org/bugs/show_bug.cgi?id=261716)
11
 *******************************************************************************/
12
13
package org.eclipse.compare;
14
15
import java.io.BufferedReader;
16
import java.io.InputStream;
17
import java.io.InputStreamReader;
18
19
import org.eclipse.core.filesystem.EFS;
20
import org.eclipse.core.runtime.IProgressMonitor;
21
import org.eclipse.jface.dialogs.MessageDialog;
22
import org.eclipse.swt.widgets.Shell;
23
import org.eclipse.ui.IEditorInput;
24
import org.eclipse.ui.PlatformUI;
25
import org.eclipse.ui.editors.text.TextFileDocumentProvider;
26
import org.eclipse.ui.texteditor.IDocumentProvider;
27
import org.eclipse.ui.texteditor.OutOfSyncHandler;
28
29
public class CompareOutOfSyncHandler extends OutOfSyncHandler {
30
31
	public boolean handle(IDocumentProvider documentProvider, IEditorInput editorInput, IProgressMonitor monitor) {
32
		
33
		//TODO Actual implementation
34
		
35
		TextFileDocumentProvider provider = (TextFileDocumentProvider) documentProvider;
36
		StringBuilder sb = new StringBuilder();
37
		try {
38
			InputStream is = provider.getFileStore(editorInput).openInputStream(EFS.NONE, monitor);
39
			BufferedReader reader = new BufferedReader(new InputStreamReader(is));
40
			String line;
41
			while ((line = reader.readLine()) != null)
42
				sb.append(line + '\n');
43
		} catch (Exception e1) {
44
			e1.printStackTrace();
45
		}
46
		
47
		Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
48
		MessageDialog.openInformation(shell, "Editor version", documentProvider.getDocument(editorInput).get()); //$NON-NLS-1$
49
		MessageDialog.openInformation(shell, "File system version", sb.toString());  //$NON-NLS-1$
50
		MessageDialog.openInformation(shell, "Compare", "Compare plug-in handled file saving."); 		 //$NON-NLS-1$ //$NON-NLS-2$
51
		return true;
52
		
53
	}
54
55
}
(-)src/org/eclipse/ui/texteditor/AbstractTextEditor.java (-7 / +30 lines)
Lines 13-18 Link Here
13
 *     Benjamin Muskalla <b.muskalla@gmx.net> - https://bugs.eclipse.org/bugs/show_bug.cgi?id=41573
13
 *     Benjamin Muskalla <b.muskalla@gmx.net> - https://bugs.eclipse.org/bugs/show_bug.cgi?id=41573
14
 *     Stephan Wahlbrink <stephan.wahlbrink@walware.de> - Wrong operations mode/feedback for text drag over/drop in text editors - https://bugs.eclipse.org/bugs/show_bug.cgi?id=206043
14
 *     Stephan Wahlbrink <stephan.wahlbrink@walware.de> - Wrong operations mode/feedback for text drag over/drop in text editors - https://bugs.eclipse.org/bugs/show_bug.cgi?id=206043
15
 *     Tom Eicher (Avaloq Evolution AG) - block selection mode
15
 *     Tom Eicher (Avaloq Evolution AG) - block selection mode
16
 *     Renato Silva - out-of-sync extension point (http://bugs.eclipse.org/bugs/show_bug.cgi?id=261716)
17
 *      
16
 *******************************************************************************/
18
 *******************************************************************************/
17
package org.eclipse.ui.texteditor;
19
package org.eclipse.ui.texteditor;
18
20
Lines 107-112 Link Here
107
import org.eclipse.jface.viewers.SelectionChangedEvent;
109
import org.eclipse.jface.viewers.SelectionChangedEvent;
108
import org.eclipse.jface.viewers.StructuredSelection;
110
import org.eclipse.jface.viewers.StructuredSelection;
109
import org.eclipse.jface.window.IShellProvider;
111
import org.eclipse.jface.window.IShellProvider;
112
import org.eclipse.jface.window.Window;
110
113
111
import org.eclipse.jface.text.AbstractInformationControlManager;
114
import org.eclipse.jface.text.AbstractInformationControlManager;
112
import org.eclipse.jface.text.BadLocationException;
115
import org.eclipse.jface.text.BadLocationException;
Lines 4943-4954 Link Here
4943
			}
4946
			}
4944
4947
4945
			if (isNotSynchronizedException(exception) && fErrorCorrectionOnSave == 1 && !isSynchronized) {
4948
			if (isNotSynchronizedException(exception) && fErrorCorrectionOnSave == 1 && !isSynchronized) {
4946
				String title= EditorMessages.Editor_error_save_outofsync_title;
4949
				
4947
				String msg= NLSUtility.format(EditorMessages.Editor_error_save_outofsync_message, getEditorInput().getToolTipText());
4950
				OutOfSyncHandler handler = selectOutOfSycHandler(OutOfSyncHandler.getContributors());
4948
4951
				if (handler != null) {
4949
				if (MessageDialog.openQuestion(getSite().getShell(), title, msg))
4952
					handler.handle(p, getEditorInput(), progressMonitor);
4950
					performSave(true, progressMonitor);
4953
				} else 
4951
				else {
4952
					/*
4954
					/*
4953
					 * 1GEUPKR: ITPJUI:ALL - Loosing work with simultaneous edits
4955
					 * 1GEUPKR: ITPJUI:ALL - Loosing work with simultaneous edits
4954
					 * Set progress monitor to canceled in order to report back
4956
					 * Set progress monitor to canceled in order to report back
Lines 4956-4962 Link Here
4956
					 */
4958
					 */
4957
					if (progressMonitor != null)
4959
					if (progressMonitor != null)
4958
						progressMonitor.setCanceled(true);
4960
						progressMonitor.setCanceled(true);
4959
				}
4961
				
4960
			} else {
4962
			} else {
4961
				String title= EditorMessages.Editor_error_save_title;
4963
				String title= EditorMessages.Editor_error_save_title;
4962
				String msg= EditorMessages.Editor_error_save_message;
4964
				String msg= EditorMessages.Editor_error_save_message;
Lines 4974-4979 Link Here
4974
			-- fErrorCorrectionOnSave;
4976
			-- fErrorCorrectionOnSave;
4975
		}
4977
		}
4976
	}
4978
	}
4979
	
4980
	/**
4981
	 * Presents a dialog for asking what to do on out-of-sync saving errors.
4982
	 * @param handlers the available handlers
4983
	 * @return the selected handler or null otherwise
4984
	 */
4985
	protected OutOfSyncHandler selectOutOfSycHandler(OutOfSyncHandler[] handlers) {		
4986
		OutOfSyncHandler defaultHandler = new OutOfSyncHandler(){			
4987
			public String getAnswer() {
4988
				return EditorMessages.Editor_error_save_outofsync_overwrite;
4989
			}			
4990
			public boolean handle(IDocumentProvider documentProvider, IEditorInput editorInput, IProgressMonitor progressMonitor) {
4991
				performSave(true, progressMonitor); 
4992
				return true;
4993
			}			
4994
		};		
4995
		OutOfSyncHandlerSelectionDialog dialog = new OutOfSyncHandlerSelectionDialog(getSite().getShell(), handlers, defaultHandler, getEditorInput().getToolTipText());
4996
		if (dialog.open() == Window.OK) 
4997
			return dialog.getSelected();
4998
		return null;
4999
	}
4977
5000
4978
	/**
5001
	/**
4979
	 * Presents an error dialog to the user when a problem
5002
	 * Presents an error dialog to the user when a problem
(-)src/org/eclipse/ui/texteditor/EditorMessages.properties (-1 / +5 lines)
Lines 23-29 Link Here
23
Editor_error_init= Editor could not be initialized.
23
Editor_error_init= Editor could not be initialized.
24
24
25
Editor_error_save_outofsync_title=Update conflict
25
Editor_error_save_outofsync_title=Update conflict
26
Editor_error_save_outofsync_message=The file ''{0}'' has been changed on the file system. Do you want to overwrite the changes made on the file system?
26
Editor_error_save_outofsync_message=The file ''{0}'' has been changed on the file system. \nWhat do you want to do?
27
Editor_error_save_outofsync_no_action_selected=Please select an action.
28
Editor_error_save_outofsync_overwrite=Overwrite file system changes anyway
27
29
28
Editor_error_activated_outofsync_title=File Changed
30
Editor_error_activated_outofsync_title=File Changed
29
Editor_error_activated_outofsync_message=The file has been changed on the file system. Do you want to replace the editor contents with these changes?
31
Editor_error_activated_outofsync_message=The file has been changed on the file system. Do you want to replace the editor contents with these changes?
Lines 118-120 Link Here
118
Editor_MoveLines_IllegalMove_status= Move not possible - Uncheck "Show Source of Selected Element Only" to see the entire document
120
Editor_MoveLines_IllegalMove_status= Move not possible - Uncheck "Show Source of Selected Element Only" to see the entire document
119
121
120
Editor_error_clipboard_copy_failed_message= Copy to clipboard failed.
122
Editor_error_clipboard_copy_failed_message= Copy to clipboard failed.
123
OutOfSyncHandlerSelectionDialog_cancel=Cancel
124
OutOfSyncHandlerSelectionDialog_ok=Ok
(-)src/org/eclipse/ui/texteditor/EditorMessages.java (+5 lines)
Lines 46-51 Link Here
46
	public static String Editor_error_init;
46
	public static String Editor_error_init;
47
	public static String Editor_error_save_outofsync_title;
47
	public static String Editor_error_save_outofsync_title;
48
	public static String Editor_error_save_outofsync_message;
48
	public static String Editor_error_save_outofsync_message;
49
	public static String Editor_error_save_outofsync_no_action_selected;
50
	public static String Editor_error_save_outofsync_overwrite;
49
	public static String Editor_error_activated_outofsync_title;
51
	public static String Editor_error_activated_outofsync_title;
50
	public static String Editor_error_activated_outofsync_message;
52
	public static String Editor_error_activated_outofsync_message;
51
	public static String Editor_error_activated_deleted_save_title;
53
	public static String Editor_error_activated_deleted_save_title;
Lines 119-124 Link Here
119
	public static String Editor_MoveLines_IllegalMove_status;
121
	public static String Editor_MoveLines_IllegalMove_status;
120
	public static String Editor_error_clipboard_copy_failed_message;
122
	public static String Editor_error_clipboard_copy_failed_message;
121
123
124
	public static String OutOfSyncHandlerSelectionDialog_cancel;
125
	public static String OutOfSyncHandlerSelectionDialog_ok;
126
122
	static {
127
	static {
123
		NLS.initializeMessages(BUNDLE_NAME, EditorMessages.class);
128
		NLS.initializeMessages(BUNDLE_NAME, EditorMessages.class);
124
	}
129
	}
(-)plugin.xml (+1 lines)
Lines 7-12 Link Here
7
    <extension-point id="rulerColumns" name="%ExtPoint.rulerColumns" schema="schema/rulerColumns.exsd"/>
7
    <extension-point id="rulerColumns" name="%ExtPoint.rulerColumns" schema="schema/rulerColumns.exsd"/>
8
    <extension-point id="hyperlinkDetectors" name="%ExtPoint.hyperlinkDetectors" schema="schema/hyperlinkDetectors.exsd"/>
8
    <extension-point id="hyperlinkDetectors" name="%ExtPoint.hyperlinkDetectors" schema="schema/hyperlinkDetectors.exsd"/>
9
    <extension-point id="hyperlinkDetectorTargets" name="%ExtPoint.hyperlinkDetectorTargets" schema="schema/hyperlinkDetectorTargets.exsd"/>
9
    <extension-point id="hyperlinkDetectorTargets" name="%ExtPoint.hyperlinkDetectorTargets" schema="schema/hyperlinkDetectorTargets.exsd"/>
10
    <extension-point id="outOfSyncHandler" name="Out Of Sync Handler" schema="schema/outOfSyncHandler.exsd"/>
10
11
11
	<extension
12
	<extension
12
	     point="org.eclipse.ui.commands">
13
	     point="org.eclipse.ui.commands">
(-)schema/outOfSyncHandler.exsd (+111 lines)
Added Link Here
1
<?xml version='1.0' encoding='UTF-8'?>
2
<!-- Schema file written by PDE -->
3
<schema targetNamespace="org.eclipse.ui.workbench.texteditor" xmlns="http://www.w3.org/2001/XMLSchema">
4
<annotation>
5
      <appInfo>
6
         <meta.schema plugin="org.eclipse.ui.workbench.texteditor" id="outOfSyncHandler" name="Out Of Sync Handler"/>
7
      </appInfo>
8
      <documentation>
9
         Allows contributors to handle out-of-sync file savings.
10
      </documentation>
11
   </annotation>
12
13
   <element name="extension">
14
      <annotation>
15
         <appInfo>
16
            <meta.element />
17
         </appInfo>
18
      </annotation>
19
      <complexType>
20
         <choice>
21
            <element ref="handler"/>
22
         </choice>
23
         <attribute name="point" type="string" use="required">
24
            <annotation>
25
               <documentation>
26
                  
27
               </documentation>
28
            </annotation>
29
         </attribute>
30
         <attribute name="id" type="string">
31
            <annotation>
32
               <documentation>
33
                  
34
               </documentation>
35
            </annotation>
36
         </attribute>
37
         <attribute name="name" type="string">
38
            <annotation>
39
               <documentation>
40
                  
41
               </documentation>
42
               <appInfo>
43
                  <meta.attribute translatable="true"/>
44
               </appInfo>
45
            </annotation>
46
         </attribute>
47
      </complexType>
48
   </element>
49
50
   <element name="handler">
51
      <complexType>
52
         <attribute name="class" type="string" use="required">
53
            <annotation>
54
               <documentation>
55
                  
56
               </documentation>
57
               <appInfo>
58
                  <meta.attribute kind="java" basedOn="org.eclipse.ui.texteditor.OutOfSyncHandler:"/>
59
               </appInfo>
60
            </annotation>
61
         </attribute>
62
         <attribute name="answer" type="string" use="required">
63
            <annotation>
64
               <documentation>
65
                  Users will be prompted for what to do, and each implementation will be listed as an available action, using this attribute as action description.
66
67
For example, the value for a compare and merge handler could be &quot;Compare and merge the versions&quot;.
68
               </documentation>
69
            </annotation>
70
         </attribute>
71
      </complexType>
72
   </element>
73
74
   <annotation>
75
      <appInfo>
76
         <meta.section type="since"/>
77
      </appInfo>
78
      <documentation>
79
         3.5
80
      </documentation>
81
   </annotation>
82
83
   <annotation>
84
      <appInfo>
85
         <meta.section type="examples"/>
86
      </appInfo>
87
      <documentation>
88
         [Enter extension point usage example here.]
89
      </documentation>
90
   </annotation>
91
92
   <annotation>
93
      <appInfo>
94
         <meta.section type="apiinfo"/>
95
      </appInfo>
96
      <documentation>
97
         [Enter API information here.]
98
      </documentation>
99
   </annotation>
100
101
   <annotation>
102
      <appInfo>
103
         <meta.section type="implementation"/>
104
      </appInfo>
105
      <documentation>
106
         [Enter information about supplied implementation of this extension point.]
107
      </documentation>
108
   </annotation>
109
110
111
</schema>
(-)src/org/eclipse/ui/texteditor/OutOfSyncHandler.java (+79 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2007, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Renato Silva - initial API and implementation 
10
 *                    (http://bugs.eclipse.org/bugs/show_bug.cgi?id=261716)
11
 *                    
12
 *******************************************************************************/
13
14
package org.eclipse.ui.texteditor;
15
16
import org.eclipse.core.runtime.CoreException;
17
import org.eclipse.core.runtime.IConfigurationElement;
18
import org.eclipse.core.runtime.IProgressMonitor;
19
import org.eclipse.core.runtime.Platform;
20
21
import org.eclipse.ui.IEditorInput;
22
23
/**
24
 * 
25
 * A handler for file saving when editor content is out-of-sync with the file system.
26
 */
27
public abstract class OutOfSyncHandler {
28
	
29
	private static String EXTENSION_POINT_ID = "org.eclipse.ui.workbench.texteditor.outOfSyncHandler"; //$NON-NLS-1$
30
	private static String ANSWER_ATTRIBUTE = "answer"; //$NON-NLS-1$
31
	private static String CLASS_ATTRIBUTE = "class"; //$NON-NLS-1$	
32
	private String answer;
33
	
34
	public static OutOfSyncHandler[] getContributors() {
35
		OutOfSyncHandler[] result;
36
		IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor(EXTENSION_POINT_ID);
37
		result = new OutOfSyncHandler[elements.length];
38
		for (int i= 0; i < elements.length; i++) {
39
			IConfigurationElement element = elements[i];
40
			Object executable;
41
			try {
42
				executable= elements[i].createExecutableExtension(CLASS_ATTRIBUTE);
43
				if (executable instanceof OutOfSyncHandler) {
44
					OutOfSyncHandler handler = ((OutOfSyncHandler) executable);
45
					handler.answer = element.getAttribute(ANSWER_ATTRIBUTE);
46
					result[i] = handler;
47
				}
48
			} catch (CoreException e) {
49
				// TODO Log failed contributor instantiation
50
			}
51
		}
52
		return result;
53
	}
54
55
	/** 
56
	 *  Users will be prompted for what to do on out-of-sync situations.
57
	 *  This will return the matching answer for the underlying handler.  
58
	 *  @return the contributed answer
59
	 */
60
	public String getAnswer() {
61
		return answer;
62
	}
63
64
	/**
65
	 * Handles the file saving when editor content is out-of-sync with the file system. 
66
	 * Must be implemented appropriately by contributors.
67
	 * 
68
	 * @param documentProvider the document provider
69
	 * @param editorInput the editor input object
70
	 * @param monitor the progress monitor
71
	 * @return true for handle success, false for any error
72
	 */
73
	
74
	//TODO Define parameters (need to include the current text and a 
75
	//     file system reference to the underlying document
76
	
77
	public abstract boolean handle(IDocumentProvider documentProvider, IEditorInput editorInput, IProgressMonitor monitor); 	
78
79
}
(-)src/org/eclipse/ui/texteditor/OutOfSyncHandlerSelectionDialog.java (+97 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2007, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Renato Silva - initial API and implementation 
10
 *                    (http://bugs.eclipse.org/bugs/show_bug.cgi?id=261716)
11
 *                    
12
 *******************************************************************************/
13
14
package org.eclipse.ui.texteditor;
15
16
import org.eclipse.swt.SWT;
17
import org.eclipse.swt.events.SelectionEvent;
18
import org.eclipse.swt.events.SelectionListener;
19
import org.eclipse.swt.layout.GridData;
20
import org.eclipse.swt.layout.GridLayout;
21
import org.eclipse.swt.widgets.Button;
22
import org.eclipse.swt.widgets.Composite;
23
import org.eclipse.swt.widgets.Control;
24
import org.eclipse.swt.widgets.Shell;
25
26
import org.eclipse.jface.dialogs.MessageDialog;
27
28
import org.eclipse.ui.internal.texteditor.NLSUtility;
29
30
/**
31
 * Presents a dialog asking the user to choose an action to be performed
32
 * when an out-of-sync file saving occurs. Each option is related to
33
 * a out-of-sync handler extension.  
34
 */
35
public class OutOfSyncHandlerSelectionDialog extends MessageDialog {
36
	
37
	private OutOfSyncHandler[] handlers;	
38
	private OutOfSyncHandler defaultHandler;
39
	private OutOfSyncHandler selectedHandler;
40
41
	/**
42
	 * Initializes the dialog.
43
	 * 
44
	 * @param parentShell the parent shell
45
	 * @param handlers the available out-of-sync handlers
46
	 * @param defaultHandler an additional, non-registered default handler
47
	 * @param fileName The underlying file name
48
	 */
49
	public OutOfSyncHandlerSelectionDialog(Shell parentShell, OutOfSyncHandler[] handlers, OutOfSyncHandler defaultHandler, String fileName) {
50
		
51
		super(parentShell, EditorMessages.Editor_error_save_outofsync_title, 
52
			null, NLSUtility.format(EditorMessages.Editor_error_save_outofsync_message, fileName), WARNING, 
53
			new String[] { EditorMessages.OutOfSyncHandlerSelectionDialog_ok, 
54
						   EditorMessages.OutOfSyncHandlerSelectionDialog_cancel }, 0);		
55
		this.handlers = handlers;
56
		this.defaultHandler = defaultHandler;
57
	}
58
	
59
	private void updateSelection(OutOfSyncHandler selected) {
60
		this.selectedHandler = selected;
61
	}
62
63
	private void createOption(Composite buttonArea, final OutOfSyncHandler handler) {
64
		Button radioButton = new Button(buttonArea, SWT.RADIO);
65
		radioButton.setText(handler.getAnswer());
66
		radioButton.addSelectionListener(new SelectionListener(){
67
			public void widgetSelected(SelectionEvent e) {
68
				updateSelection(handler);
69
			}
70
			public void widgetDefaultSelected(SelectionEvent e) {
71
				updateSelection(handler);
72
			}
73
		});
74
	}
75
76
	protected Control createCustomArea(Composite parent) {		
77
		Composite buttonArea = new Composite(parent, SWT.NULL);
78
		buttonArea.setLayout(new GridLayout(1, true));
79
		GridData data = new GridData(SWT.FILL, SWT.FILL, true, false);
80
		data.horizontalIndent = 38;
81
		buttonArea.setLayoutData(data);		
82
		for (int i = 0; i < handlers.length; i++)
83
			if (handlers[i] != null)
84
				createOption(buttonArea, handlers[i]);
85
		createOption(buttonArea, defaultHandler);
86
		return parent;
87
	}
88
89
	/**
90
	 * Gets the selected handler. Should normally be called after an <code>open()</code>.
91
	 * @return the selected handler
92
	 */
93
	public OutOfSyncHandler getSelected() {
94
		return selectedHandler;
95
	}
96
	
97
}
(-)src/org/eclipse/ui/editors/text/TextFileDocumentProvider.java (-1 / +6 lines)
Lines 1277-1285 Link Here
1277
	 * @return the {@link IFileStore} for the given file info
1277
	 * @return the {@link IFileStore} for the given file info
1278
	 * @since 3.2
1278
	 * @since 3.2
1279
	 */
1279
	 */
1280
	protected IFileStore getFileStore(FileInfo info)  {
1280
	protected IFileStore getFileStore(FileInfo info) {
1281
		return info.fTextFileBuffer.getFileStore();
1281
		return info.fTextFileBuffer.getFileStore();
1282
	}
1282
	}
1283
	
1284
	public IFileStore getFileStore(Object element) {
1285
		FileInfo info= (FileInfo) fFileInfoMap.get(element);
1286
		return getFileStore(info);
1287
	}
1283
1288
1284
	/**
1289
	/**
1285
	 * Returns the system file denoted by the given info.
1290
	 * Returns the system file denoted by the given info.

Return to bug 261716