本文整理汇总了Java中org.eclipse.ui.ide.IDE.gotoMarker方法的典型用法代码示例。如果您正苦于以下问题:Java IDE.gotoMarker方法的具体用法?Java IDE.gotoMarker怎么用?Java IDE.gotoMarker使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ui.ide.IDE
的用法示例。
在下文中一共展示了IDE.gotoMarker方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: gotoMarker
import org.eclipse.ui.ide.IDE; //导入方法依赖的package包/类
public void gotoMarker(IMarker marker) {
if (activePage == PAGE_DESIGNER) {
try {
Object expr = marker.getAttribute(JRErrorHandler.MARKER_ERROR_JREXPRESSION);
if (expr != null && expr instanceof String) {
JRDesignExpression expression = new JRDesignExpression();
expression.setId(new Integer((String) expr));
JasperDesign jd = getJasperDesign();
JRExpressionCollector rc = JRExpressionCollector.collector(jrContext, jd);
if (!VErrorPreview.openExpressionEditor(jrContext, rc, (JRDesignDataset) jd.getMainDataset(), expression))
for (JRDataset d : jd.getDatasetsList())
if (VErrorPreview.openExpressionEditor(jrContext, rc, (JRDesignDataset) d, expression))
return;
}
} catch (CoreException e) {
e.printStackTrace();
}
}
setActivePage(PAGE_XMLEDITOR);
IDE.gotoMarker(xmlEditor, marker);
}
示例2: jumpToBugPosition
import org.eclipse.ui.ide.IDE; //导入方法依赖的package包/类
private void jumpToBugPosition(BugPathItem bpi) {
CcConfiguration config = new CcConfiguration(currentProject);
String relName = config.convertFilenameFromServer(bpi.getFile());
IFile fileinfo = currentProject.getFile(relName);
if (fileinfo != null && fileinfo.exists()) {
if(!fileinfo.getName().equals(currentFilename)) {
this.setViewerRefresh(false);
} else {
this.setViewerRefresh(true);
}
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getActivePage();
HashMap<String, Object> map = new HashMap<String, Object>();
map.put(IMarker.LINE_NUMBER, new Integer((int) bpi.getStartPosition().getLine()));
map.put(IDE.EDITOR_ID_ATTR, "org.eclipse.ui.DefaultTextEditor");
IMarker marker;
try {
marker = fileinfo.createMarker(IMarker.TEXT);
marker.setAttributes(map);
IDE.openEditor(page, fileinfo);
IDE.gotoMarker(page.getActiveEditor(), marker);
marker.delete();
} catch (CoreException e) {
Logger.log(IStatus.ERROR, " " + e);
Logger.log(IStatus.INFO, " " + e.getStackTrace());
}
}
}
示例3: gotoBookmark
import org.eclipse.ui.ide.IDE; //导入方法依赖的package包/类
@Override
public boolean gotoBookmark(IWorkbenchWindow window, Bookmark bookmark, IBookmarkLocation bookmarkLocation) {
if (!(bookmarkLocation instanceof JavaMarkerBookmarkLocation)) {
return false;
}
JavaMarkerBookmarkLocation javaMarkerBookmarkLocation = (JavaMarkerBookmarkLocation) bookmarkLocation;
IJavaElement javaElement = JavaCore.create(javaMarkerBookmarkLocation.getHandle());
if (javaElement == null) {
return false;
}
IEditorInput editorInput = EditorUtility.getEditorInput(javaElement);
if (editorInput == null) {
return false;
}
String editorId = getEditorId(editorInput);
if (editorId == null) {
return false;
}
try {
IEditorPart editorPart = IDE.openEditor(window.getActivePage(), editorInput, editorId);
if (editorPart == null) {
return false;
}
IDE.gotoMarker(editorPart, javaMarkerBookmarkLocation.getMarker());
return true;
} catch (PartInitException e) {
return false;
}
}
示例4: gotoMarker
import org.eclipse.ui.ide.IDE; //导入方法依赖的package包/类
/**
* Goto marker.
*
* @param marker the marker
*/
/* (non-Javadoc)
* Method declared on IEditorPart
*/
public void gotoMarker(IMarker marker) {
setActivePage(0);
IDE.gotoMarker(getEditor(0), marker);
}
示例5: gotoMarker
import org.eclipse.ui.ide.IDE; //导入方法依赖的package包/类
/**
* Goto marker.
*
* @param marker the marker
*/
/*
* (non-Javadoc) Method declared on IEditorPart
*/
public void gotoMarker(IMarker marker) {
setActivePage(0);
IDE.gotoMarker(getEditor(0), marker);
}
开发者ID:germanattanasio,项目名称:traceability-assistant-eclipse-plugins,代码行数:13,代码来源:TraceabilityEditor.java
示例6: gotoMarker
import org.eclipse.ui.ide.IDE; //导入方法依赖的package包/类
/**
* @see org.eclipse.ui.ide.IGotoMarker#gotoMarker(org.eclipse.core.resources.IMarker)
*/
public void gotoMarker(IMarker marker) {
IResource resource = marker.getResource();
Locale[] locales = messagesBundleGroup.getLocales();
for (int i = 0; i < locales.length; i++) {
IMessagesResource messagesResource = ((MessagesBundle) messagesBundleGroup
.getMessagesBundle(locales[i])).getResource();
if (messagesResource instanceof EclipsePropertiesEditorResource) {
EclipsePropertiesEditorResource propFile = (EclipsePropertiesEditorResource) messagesResource;
if (resource.equals(propFile.getResource())) {
// ok we got the locale.
// try to open the master i18n page and select the
// corresponding key.
try {
String key = (String) marker
.getAttribute(IMarker.LOCATION);
if (key != null && key.length() > 0) {
getI18NPage().selectLocale(locales[i]);
setActivePage(0);
setSelectedKey(key);
return;
}
} catch (Exception e) {
e.printStackTrace();// something better.s
}
// it did not work... fall back to the text editor.
setActivePage(locales[i]);
IDE.gotoMarker((IEditorPart) propFile.getSource(), marker);
break;
}
}
}
// }
}
示例7: gotoMarker
import org.eclipse.ui.ide.IDE; //导入方法依赖的package包/类
public void gotoMarker(IMarker marker) {
setActivePage(0);
IDE.gotoMarker(getEditor(0), marker);
}
示例8: gotoMarker
import org.eclipse.ui.ide.IDE; //导入方法依赖的package包/类
public void gotoMarker(IMarker marker) {
setActivePage(pageIndex);
IDE.gotoMarker(getEditor(pageIndex), marker);
}
示例9: gotoMarker
import org.eclipse.ui.ide.IDE; //导入方法依赖的package包/类
public void gotoMarker(IMarker marker) {
setActivePage(0);
IDE.gotoMarker(getEditor(0), marker);
}
示例10: gotoMarker
import org.eclipse.ui.ide.IDE; //导入方法依赖的package包/类
public void gotoMarker(IMarker marker) {
setActivePage(srcPage);
IDE.gotoMarker(getEditor(srcPage), marker);
}
示例11: gotoMarker
import org.eclipse.ui.ide.IDE; //导入方法依赖的package包/类
/**
* @see org.eclipse.ui.ide.IGotoMarker#gotoMarker(
* org.eclipse.core.resources.IMarker)
*/
public void gotoMarker(IMarker marker) {
// String key = marker.getAttribute(RBEMarker.KEY, "");
// if (key != null && key.length() > 0) {
// setActivePage(0);
// setSelectedKey(key);
// getI18NPage().selectLocale(BabelUtils.parseLocale(
// marker.getAttribute(RBEMarker.LOCALE, "")));
// } else {
IResource resource = marker.getResource();
Locale[] locales = messagesBundleGroup.getLocales();
for (int i = 0; i < locales.length; i++) {
IMessagesResource messagesResource =
messagesBundleGroup.getMessagesBundle(locales[i]).getResource();
if (messagesResource instanceof EclipsePropertiesEditorResource) {
EclipsePropertiesEditorResource propFile =
(EclipsePropertiesEditorResource) messagesResource;
if (resource.equals(propFile.getResource())) {
//ok we got the locale.
//try to open the master i18n page and select the corresponding key.
try {
String key = (String) marker.getAttribute(IMarker.LOCATION);
if (key != null && key.length() > 0) {
getI18NPage().selectLocale(locales[i]);
setActivePage(0);
setSelectedKey(key);
return;
}
} catch (Exception e) {
e.printStackTrace();//something better.s
}
//it did not work... fall back to the text editor.
setActivePage(locales[i]);
IDE.gotoMarker(
(IEditorPart) propFile.getSource(), marker);
break;
}
}
}
// }
}