Skip to content

Commit

Permalink
兼容eclipse juno
Browse files Browse the repository at this point in the history
  • Loading branch information
huangbin committed Oct 10, 2016
1 parent 6939b6a commit 0daa8d8
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 26 deletions.
19 changes: 9 additions & 10 deletions META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@ Bundle-Name: P3
Bundle-SymbolicName: codeplus;singleton:=true
Bundle-Version: 1.1.0.qualifier
Bundle-Activator: codeplus.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.jdt.core;bundle-version="3.11.0",
org.eclipse.wst.sse.core;bundle-version="1.1.900",
org.eclipse.wst.xml.core;bundle-version="1.1.902",
org.eclipse.core.resources;bundle-version="3.10.0",
org.eclipse.wst.validation;bundle-version="1.2.600",
org.eclipse.core.filesystem;bundle-version="1.5.0",
org.eclipse.text,
org.eclipse.jface.text;bundle-version="3.10.0"
Require-Bundle: org.eclipse.ui;bundle-version="3.104.0",
org.eclipse.core.runtime;bundle-version="3.8.0",
org.eclipse.jdt.core;bundle-version="3.8.3",
org.eclipse.wst.sse.core;bundle-version="1.1.702",
org.eclipse.wst.xml.core;bundle-version="1.1.702",
org.eclipse.core.resources;bundle-version="3.8.1",
org.eclipse.wst.validation;bundle-version="1.2.402",
org.eclipse.core.filesystem;bundle-version="1.3.200",
org.eclipse.jface.text;bundle-version="3.8.2"
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Import-Package: org.eclipse.jdt.internal.ui.javaeditor,
Expand Down
6 changes: 3 additions & 3 deletions src/codeplus/hover/JavaDaoHover.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ private String[] getNamespaceAndSqlid() throws BadLocationException {
wholeSqlId = selected;
}

IFile file = currentEditor.getEditorInput().getAdapter(IFile.class);
IFile file = (IFile) currentEditor.getEditorInput().getAdapter(IFile.class);
String fileName = file.getName();
if (fileName.matches(FindMapperXml.MATCH_REG)) {
String namespace = null;
Expand Down Expand Up @@ -135,7 +135,7 @@ public IInformationControlCreator getInformationPresenterControlCreator() {
IAction action1 = new Action() {
public void run() {
try {
IFile file = currentEditor.getEditorInput().getAdapter(IFile.class);
IFile file = (IFile) currentEditor.getEditorInput().getAdapter(IFile.class);
String fileName = file.getName();
if (fileName.matches(FindMapperXml.MATCH_REG)) {
String[] arr = getNamespaceAndSqlid();
Expand Down Expand Up @@ -172,7 +172,7 @@ public void run() {
IAction action2 = new Action() {
public void run() {
try {
IFile file = currentEditor.getEditorInput().getAdapter(IFile.class);
IFile file = (IFile) currentEditor.getEditorInput().getAdapter(IFile.class);
String fileName = file.getName();
if (fileName.matches(FindMapperXml.MATCH_REG)) {
String[] arr = getNamespaceAndSqlid();
Expand Down
2 changes: 1 addition & 1 deletion src/codeplus/popup/GoDeclarationInterfaceDelegate.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void run(IAction action) {
ITextSelection ts = (ITextSelection) i;
int off = ts.getOffset();

IFile file = currentEditor.getEditorInput().getAdapter(IFile.class);
IFile file = (IFile) currentEditor.getEditorInput().getAdapter(IFile.class);
String fileName = file.getName();
String content = EditorUtil.getText(currentEditor);
String methodName = TextUtil.getSelectedWord(content, off);
Expand Down
11 changes: 1 addition & 10 deletions src/codeplus/popup/GoSqlXmlActionDelegate.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,18 @@
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.ITextSelection;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IEditorActionDelegate;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.ActionDelegate;
import org.eclipse.ui.ide.IDE;
import org.eclipse.ui.texteditor.IDocumentProvider;
import org.eclipse.ui.texteditor.ITextEditor;

import codeplus.Activator;
import codeplus.util.EditorUtil;
import codeplus.util.TextUtil;
import codeplus.util.XmlUtil;
import codeplus.util.XmlUtil.MatchFile;
import codeplus.util.mapper.FindMapperXml;
import codeplus.util.mapper.MapperNamespaceCache;

public class GoSqlXmlActionDelegate extends ActionDelegate implements IEditorActionDelegate {

Expand All @@ -45,7 +36,7 @@ public void run(IAction action) {
ITextSelection ts = (ITextSelection) i;
int off = ts.getOffset();

IFile file = currentEditor.getEditorInput().getAdapter(IFile.class);
IFile file = (IFile) currentEditor.getEditorInput().getAdapter(IFile.class);
String fileName = file.getName();
if (fileName.matches(FindMapperXml.MATCH_REG)) {
String content = EditorUtil.getText(currentEditor);
Expand Down
4 changes: 2 additions & 2 deletions src/codeplus/util/EditorUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
public class EditorUtil {

public static String getText(IEditorPart je) {
IFile file = je.getEditorInput().getAdapter(IFile.class);
IFile file = (IFile) je.getEditorInput().getAdapter(IFile.class);
String charset = null;
try {
charset = file.getCharset();
Expand All @@ -40,7 +40,7 @@ public static String getText(IEditorPart je) {
}

public static String getFileName(IEditorPart je) {
IFile file = je.getEditorInput().getAdapter(IFile.class);
IFile file = (IFile) je.getEditorInput().getAdapter(IFile.class);
return file.getName();
}

Expand Down

0 comments on commit 0daa8d8

Please sign in to comment.