woproject/projects/wolips/plugins/org.objectstyle.wolips.componenteditor/java/org/objectstyle/wolips/componenteditor/part ComponentEditor.java,1.1,1.2
[email protected] Wed, 1 Mar 2006 08:55:13 -0800 (PST)
| Newsgroups | gmane.comp.web.webobjects.woproject.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/woproject/woproject/projects/wolips/plugins/org.objectstyle.wolips.componenteditor/java/org/objectstyle/wolips/componenteditor/part
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29536/java/org/objectstyle/wolips/componenteditor/part
Modified Files:
ComponentEditor.java
Log Message:
allways asume that the debugger is calling
Index: ComponentEditor.java
===================================================================
RCS file: /cvsroot/woproject/woproject/projects/wolips/plugins/org.objectstyle.wolips.componenteditor/java/org/objectstyle/wolips/componenteditor/part/ComponentEditor.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- ComponentEditor.java 1 Mar 2006 16:43:43 -0000 1.1
+++ ComponentEditor.java 1 Mar 2006 16:54:35 -0000 1.2
@@ -69,182 +69,122 @@
public IDocumentProvider getDocumentProvider() {
- IEditorPart editorPart = this.getActiveEditor();
- if(editorPart == null) {
- return null;
- }
- if(!(editorPart instanceof ITextEditor)) {
- return null;
+ if(this.getActivePage() != 0) {
+ this.switchToJava();
}
- ITextEditor textEditor = (ITextEditor)editorPart;
+ ITextEditor textEditor = (ITextEditor)compilationUnitEditor;
return textEditor.getDocumentProvider();
}
public void close(boolean save) {
- IEditorPart editorPart = this.getActiveEditor();
- if(editorPart == null) {
- return;
- }
- if(!(editorPart instanceof ITextEditor)) {
- return;
+ if(this.getActivePage() != 0) {
+ this.switchToJava();
}
- ITextEditor textEditor = (ITextEditor)editorPart;
+ ITextEditor textEditor = (ITextEditor)compilationUnitEditor;
textEditor.close(save);
}
public boolean isEditable() {
- IEditorPart editorPart = this.getActiveEditor();
- if(editorPart == null) {
- return false;
- }
- if(!(editorPart instanceof ITextEditor)) {
- return false;
+ if(this.getActivePage() != 0) {
+ this.switchToJava();
}
- ITextEditor textEditor = (ITextEditor)editorPart;
+ ITextEditor textEditor = (ITextEditor)compilationUnitEditor;
return textEditor.isEditable();
}
public void doRevertToSaved() {
- IEditorPart editorPart = this.getActiveEditor();
- if(editorPart == null) {
- return;
- }
- if(!(editorPart instanceof ITextEditor)) {
- return;
+ if(this.getActivePage() != 0) {
+ this.switchToJava();
}
- ITextEditor textEditor = (ITextEditor)editorPart;
+ ITextEditor textEditor = (ITextEditor)compilationUnitEditor;
textEditor.doRevertToSaved();
}
public void setAction(String actionID, IAction action) {
- IEditorPart editorPart = this.getActiveEditor();
- if(editorPart == null) {
- return;
- }
- if(!(editorPart instanceof ITextEditor)) {
- return;
+ if(this.getActivePage() != 0) {
+ this.switchToJava();
}
- ITextEditor textEditor = (ITextEditor)editorPart;
+ ITextEditor textEditor = (ITextEditor)compilationUnitEditor;
textEditor.setAction(actionID, action);
}
public IAction getAction(String actionId) {
- IEditorPart editorPart = this.getActiveEditor();
- if(editorPart == null) {
- return null;
- }
- if(!(editorPart instanceof ITextEditor)) {
- return null;
+ if(this.getActivePage() != 0) {
+ this.switchToJava();
}
- ITextEditor textEditor = (ITextEditor)editorPart;
+ ITextEditor textEditor = (ITextEditor)compilationUnitEditor;
return textEditor.getAction(actionId);
}
public void setActionActivationCode(String actionId, char activationCharacter, int activationKeyCode, int activationStateMask) {
- IEditorPart editorPart = this.getActiveEditor();
- if(editorPart == null) {
- return;
- }
- if(!(editorPart instanceof ITextEditor)) {
- return;
+ if(this.getActivePage() != 0) {
+ this.switchToJava();
}
- ITextEditor textEditor = (ITextEditor)editorPart;
+ ITextEditor textEditor = (ITextEditor)compilationUnitEditor;
textEditor.setActionActivationCode(actionId, activationCharacter, activationKeyCode, activationStateMask);
}
public void removeActionActivationCode(String actionId) {
- IEditorPart editorPart = this.getActiveEditor();
- if(editorPart == null) {
- return;
- }
- if(!(editorPart instanceof ITextEditor)) {
- return;
+ if(this.getActivePage() != 0) {
+ this.switchToJava();
}
- ITextEditor textEditor = (ITextEditor)editorPart;
+ ITextEditor textEditor = (ITextEditor)compilationUnitEditor;
textEditor.removeActionActivationCode(actionId);
}
public boolean showsHighlightRangeOnly() {
- IEditorPart editorPart = this.getActiveEditor();
- if(editorPart == null) {
- return false;
- }
- if(!(editorPart instanceof ITextEditor)) {
- return false;
+ if(this.getActivePage() != 0) {
+ this.switchToJava();
}
- ITextEditor textEditor = (ITextEditor)editorPart;
+ ITextEditor textEditor = (ITextEditor)compilationUnitEditor;
return textEditor.showsHighlightRangeOnly();
}
public void showHighlightRangeOnly(boolean showHighlightRangeOnly) {
- IEditorPart editorPart = this.getActiveEditor();
- if(editorPart == null) {
- return;
- }
- if(!(editorPart instanceof ITextEditor)) {
- return;
+ if(this.getActivePage() != 0) {
+ this.switchToJava();
}
- ITextEditor textEditor = (ITextEditor)editorPart;
+ ITextEditor textEditor = (ITextEditor)compilationUnitEditor;
textEditor.showHighlightRangeOnly(showHighlightRangeOnly);
}
public void setHighlightRange(int offset, int length, boolean moveCursor) {
- IEditorPart editorPart = this.getActiveEditor();
- if(editorPart == null) {
- return;
- }
- if(!(editorPart instanceof ITextEditor)) {
- return;
+ if(this.getActivePage() != 0) {
+ this.switchToJava();
}
- ITextEditor textEditor = (ITextEditor)editorPart;
+ ITextEditor textEditor = (ITextEditor)compilationUnitEditor;
textEditor.setHighlightRange(offset, length, moveCursor);
}
public IRegion getHighlightRange() {
- IEditorPart editorPart = this.getActiveEditor();
- if(editorPart == null) {
- return null;
- }
- if(!(editorPart instanceof ITextEditor)) {
- return null;
+ if(this.getActivePage() != 0) {
+ this.switchToJava();
}
- ITextEditor textEditor = (ITextEditor)editorPart;
+ ITextEditor textEditor = (ITextEditor)compilationUnitEditor;
return textEditor.getHighlightRange();
}
public void resetHighlightRange() {
- IEditorPart editorPart = this.getActiveEditor();
- if(editorPart == null) {
- return;
- }
- if(!(editorPart instanceof ITextEditor)) {
- return;
+ if(this.getActivePage() != 0) {
+ this.switchToJava();
}
- ITextEditor textEditor = (ITextEditor)editorPart;
+ ITextEditor textEditor = (ITextEditor)compilationUnitEditor;
textEditor.resetHighlightRange();
}
public ISelectionProvider getSelectionProvider() {
- IEditorPart editorPart = this.getActiveEditor();
- if(editorPart == null) {
- return null;
- }
- if(!(editorPart instanceof ITextEditor)) {
- return null;
+ if(this.getActivePage() != 0) {
+ this.switchToJava();
}
- ITextEditor textEditor = (ITextEditor)editorPart;
+ ITextEditor textEditor = (ITextEditor)compilationUnitEditor;
return textEditor.getSelectionProvider();
}
public void selectAndReveal(int offset, int length) {
- IEditorPart editorPart = this.getActiveEditor();
- if(editorPart == null) {
- return;
- }
- if(!(editorPart instanceof ITextEditor)) {
- return;
+ if(this.getActivePage() != 0) {
+ this.switchToJava();
}
- ITextEditor textEditor = (ITextEditor)editorPart;
+ ITextEditor textEditor = (ITextEditor)compilationUnitEditor;
textEditor.selectAndReveal(offset, length);
}
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642