Lines 26-41
Link Here
|
26 |
import org.eclipse.core.runtime.IStatus; |
26 |
import org.eclipse.core.runtime.IStatus; |
27 |
import org.eclipse.hyades.ui.HyadesUIPlugin; |
27 |
import org.eclipse.hyades.ui.HyadesUIPlugin; |
28 |
import org.eclipse.hyades.ui.adapter.ISynchronizedEditorAdapter; |
28 |
import org.eclipse.hyades.ui.adapter.ISynchronizedEditorAdapter; |
|
|
29 |
import org.eclipse.hyades.ui.editor.HyadesEditorActionContributor; |
29 |
import org.eclipse.hyades.ui.util.IDisposable; |
30 |
import org.eclipse.hyades.ui.util.IDisposable; |
30 |
import org.eclipse.jface.dialogs.MessageDialog; |
31 |
import org.eclipse.jface.dialogs.MessageDialog; |
|
|
32 |
import org.eclipse.ui.IEditorActionBarContributor; |
31 |
import org.eclipse.ui.IEditorInput; |
33 |
import org.eclipse.ui.IEditorInput; |
32 |
import org.eclipse.ui.IEditorPart; |
34 |
import org.eclipse.ui.IEditorPart; |
|
|
35 |
import org.eclipse.ui.IEditorSite; |
33 |
import org.eclipse.ui.IFileEditorInput; |
36 |
import org.eclipse.ui.IFileEditorInput; |
34 |
import org.eclipse.ui.IPartListener; |
37 |
import org.eclipse.ui.IPartListener; |
35 |
import org.eclipse.ui.IPartListener2; |
38 |
import org.eclipse.ui.IPartListener2; |
36 |
import org.eclipse.ui.IWindowListener; |
39 |
import org.eclipse.ui.IWindowListener; |
37 |
import org.eclipse.ui.IWorkbenchPart; |
40 |
import org.eclipse.ui.IWorkbenchPart; |
38 |
import org.eclipse.ui.IWorkbenchPartReference; |
41 |
import org.eclipse.ui.IWorkbenchPartReference; |
|
|
42 |
import org.eclipse.ui.IWorkbenchSite; |
39 |
import org.eclipse.ui.IWorkbenchWindow; |
43 |
import org.eclipse.ui.IWorkbenchWindow; |
40 |
import org.eclipse.ui.PlatformUI; |
44 |
import org.eclipse.ui.PlatformUI; |
41 |
import org.eclipse.ui.part.FileEditorInput; |
45 |
import org.eclipse.ui.part.FileEditorInput; |
Lines 738-743
Link Here
|
738 |
|
742 |
|
739 |
if(ref.getPart(false) == getEditorPart()) |
743 |
if(ref.getPart(false) == getEditorPart()) |
740 |
checkOSFiles(); |
744 |
checkOSFiles(); |
|
|
745 |
updateStatusLineWritableField(ref); |
741 |
} |
746 |
} |
742 |
|
747 |
|
743 |
/** |
748 |
/** |
Lines 766-773
Link Here
|
766 |
*/ |
771 |
*/ |
767 |
public void partOpened(IWorkbenchPartReference ref) |
772 |
public void partOpened(IWorkbenchPartReference ref) |
768 |
{ |
773 |
{ |
|
|
774 |
updateStatusLineWritableField(ref); |
769 |
} |
775 |
} |
770 |
|
776 |
|
|
|
777 |
private void updateStatusLineWritableField(IWorkbenchPartReference ref) { |
778 |
if(ref.getPart(false) == getEditorPart()) { |
779 |
IWorkbenchSite site = ref.getPart(false).getSite(); |
780 |
if (site instanceof IEditorSite) { |
781 |
IEditorSite eSite = (IEditorSite) site; |
782 |
IEditorActionBarContributor contributor = eSite.getActionBarContributor(); |
783 |
if (contributor instanceof HyadesEditorActionContributor) { |
784 |
HyadesEditorActionContributor hyadesContrib = (HyadesEditorActionContributor) contributor; |
785 |
hyadesContrib.setWritable(!getEditorOSFile().isReadOnly()); |
786 |
} |
787 |
} |
788 |
} |
789 |
} |
790 |
|
771 |
/** |
791 |
/** |
772 |
* @see org.eclipse.ui.IPartListener2#partHidden(org.eclipse.ui.IWorkbenchPartReference) |
792 |
* @see org.eclipse.ui.IPartListener2#partHidden(org.eclipse.ui.IWorkbenchPartReference) |
773 |
*/ |
793 |
*/ |