-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
af581a5
commit 9fd3b8e
Showing
5 changed files
with
139 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
...seasar/dbflute/emecha/eclipse/plugin/dfassist/link/OutsideSqlEntityHyperlinkDetector.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* Copyright 2013 the Seasar Foundation and the Others. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | ||
* either express or implied. See the License for the specific language | ||
* governing permissions and limitations under the License. | ||
*/ | ||
package org.seasar.dbflute.emecha.eclipse.plugin.dfassist.link; | ||
|
||
import java.util.List; | ||
|
||
import org.eclipse.jdt.core.IJavaElement; | ||
import org.eclipse.jdt.core.IType; | ||
import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor; | ||
import org.eclipse.jdt.ui.actions.SelectionDispatchAction; | ||
import org.eclipse.jface.text.IRegion; | ||
import org.eclipse.jface.text.hyperlink.IHyperlink; | ||
|
||
import friend.org.eclipse.jdt.internal.ui.javaeditor.JavaElementHyperlinkDetector; | ||
|
||
/** | ||
* | ||
* @author schatten | ||
*/ | ||
@SuppressWarnings("restriction") | ||
public class OutsideSqlEntityHyperlinkDetector extends JavaElementHyperlinkDetector { | ||
/** | ||
* @see org.eclipse.jdt.internal.ui.javaeditor.JavaElementHyperlinkDetector#addHyperlinks(org.eclipse.jface.text.IRegion, org.eclipse.jdt.ui.actions.SelectionDispatchAction, org.eclipse.jdt.core.IJavaElement, boolean, org.eclipse.ui.texteditor.ITextEditor) | ||
*/ | ||
@Override | ||
protected void addHyperlinks(List<IHyperlink> hyperlinksCollector, IRegion wordRegion, | ||
SelectionDispatchAction openAction, IJavaElement element, boolean qualify, JavaEditor editor) { | ||
|
||
if (element instanceof IType) { | ||
String packageName = ((IType) element).getPackageFragment().getElementName(); | ||
if (packageName.endsWith(".exbhv.pmbean") || packageName.endsWith(".bsbhv.pmbean")) { | ||
CustomizeEntityHyperlink entityLink = new CustomizeEntityHyperlink(wordRegion, openAction, (IType) element, qualify); | ||
if (entityLink.existEntityType()) { | ||
hyperlinksCollector.add(entityLink); | ||
} | ||
} else if (packageName.endsWith(".exentity.customize") || packageName.endsWith(".bsentity.customize")) { | ||
ParameterBeanHyperlink pmbLink = new ParameterBeanHyperlink(wordRegion, openAction, (IType) element, qualify); | ||
if (pmbLink.existPmbType()) { | ||
hyperlinksCollector.add(pmbLink); | ||
} | ||
} | ||
} | ||
} | ||
} |
65 changes: 65 additions & 0 deletions
65
...g/seasar/dbflute/emecha/eclipse/plugin/dfassist/link/OutsideSqlFileHyperlinkDetector.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* Copyright 2013 the Seasar Foundation and the Others. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | ||
* either express or implied. See the License for the specific language | ||
* governing permissions and limitations under the License. | ||
*/ | ||
package org.seasar.dbflute.emecha.eclipse.plugin.dfassist.link; | ||
|
||
import java.util.List; | ||
|
||
import org.eclipse.jdt.core.IField; | ||
import org.eclipse.jdt.core.IJavaElement; | ||
import org.eclipse.jdt.core.IType; | ||
import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor; | ||
import org.eclipse.jdt.ui.actions.SelectionDispatchAction; | ||
import org.eclipse.jface.text.IRegion; | ||
import org.eclipse.jface.text.hyperlink.IHyperlink; | ||
|
||
import friend.org.eclipse.jdt.internal.ui.javaeditor.JavaElementHyperlinkDetector; | ||
|
||
/** | ||
* | ||
* @author schatten | ||
*/ | ||
@SuppressWarnings("restriction") | ||
public class OutsideSqlFileHyperlinkDetector extends JavaElementHyperlinkDetector { | ||
/** | ||
* @see org.eclipse.jdt.internal.ui.javaeditor.JavaElementHyperlinkDetector#addHyperlinks(org.eclipse.jface.text.IRegion, org.eclipse.jdt.ui.actions.SelectionDispatchAction, org.eclipse.jdt.core.IJavaElement, boolean, org.eclipse.ui.texteditor.ITextEditor) | ||
*/ | ||
@Override | ||
protected void addHyperlinks(List<IHyperlink> hyperlinksCollector, IRegion wordRegion, | ||
SelectionDispatchAction openAction, IJavaElement element, boolean qualify, JavaEditor editor) { | ||
|
||
if (element instanceof IType) { | ||
String packageName = ((IType) element).getPackageFragment().getElementName(); | ||
if (packageName.endsWith(".exbhv.pmbean") || packageName.endsWith(".bsbhv.pmbean")) { | ||
SqlFileHyperlink sqlLink = new SqlFileHyperlink(wordRegion, openAction, (IType) element, qualify); | ||
if (sqlLink.existSqlFile()) { | ||
hyperlinksCollector.add(sqlLink); | ||
} | ||
} else if (packageName.endsWith(".exentity.customize") || packageName.endsWith(".bsentity.customize")) { | ||
SqlFileHyperlink sqlLink = new SqlFileHyperlink(wordRegion, openAction, (IType) element, qualify); | ||
if (sqlLink.existSqlFile()) { | ||
hyperlinksCollector.add(sqlLink); | ||
} | ||
} | ||
} else if (element instanceof IField) { | ||
if (element.getElementName().startsWith("PATH_")) { | ||
SqlFileHyperlink sqlLink = new SqlFileHyperlink(wordRegion, openAction, (IField) element, qualify); | ||
if (sqlLink.existSqlFile()) { | ||
hyperlinksCollector.add(sqlLink); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters