本文整理匯總了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;
}
}
}
// }
}