Lines 15-26
Link Here
|
15 |
|
15 |
|
16 |
import java.util.ResourceBundle; |
16 |
import java.util.ResourceBundle; |
17 |
|
17 |
|
|
|
18 |
import org.eclipse.jface.text.ITextOperationTarget; |
18 |
import org.eclipse.swt.custom.BusyIndicator; |
19 |
import org.eclipse.swt.custom.BusyIndicator; |
19 |
import org.eclipse.swt.widgets.Display; |
20 |
import org.eclipse.swt.widgets.Display; |
20 |
import org.eclipse.swt.widgets.Shell; |
21 |
import org.eclipse.swt.widgets.Shell; |
21 |
|
|
|
22 |
import org.eclipse.jface.text.ITextOperationTarget; |
23 |
|
24 |
import org.eclipse.ui.IWorkbenchPartSite; |
22 |
import org.eclipse.ui.IWorkbenchPartSite; |
25 |
|
23 |
|
26 |
|
24 |
|
Lines 93-98
Link Here
|
93 |
fRunsOnReadOnly= runsOnReadOnly; |
91 |
fRunsOnReadOnly= runsOnReadOnly; |
94 |
update(); |
92 |
update(); |
95 |
} |
93 |
} |
|
|
94 |
|
95 |
/** |
96 |
* Checks whether the action should be enabled. This verifies that the text |
97 |
* editor on which the operation is meant to act is the same as the control |
98 |
* that currently has focus. Otherwise, it allows its super class to |
99 |
* decide. |
100 |
* @return <code>false</code> if the control with focus is not the control |
101 |
* used by this text editor; otherwise decided by the super class. |
102 |
*/ |
103 |
public final boolean isEnabled() { |
104 |
final ITextEditor textEditor = getTextEditor(); |
105 |
if (textEditor instanceof AbstractTextEditor) { |
106 |
final AbstractTextEditor abstractEditor = (AbstractTextEditor) textEditor; |
107 |
if (!abstractEditor.usesControl(Display.getCurrent().getFocusControl())) { |
108 |
return false; |
109 |
} |
110 |
} |
111 |
|
112 |
return super.isEnabled(); |
113 |
} |
96 |
|
114 |
|
97 |
/** |
115 |
/** |
98 |
* The <code>TextOperationAction</code> implementation of this |
116 |
* The <code>TextOperationAction</code> implementation of this |