当前位置: 首页>>代码示例>>Java>>正文


Java IDE.gotoMarker方法代码示例

本文整理汇总了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);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:22,代码来源:JrxmlEditor.java

示例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());
        }
    }
}
 
开发者ID:Ericsson,项目名称:CodeCheckerEclipsePlugin,代码行数:31,代码来源:ReportListView.java

示例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;
	}
}
 
开发者ID:cchabanois,项目名称:mesfavoris,代码行数:30,代码来源:GotoJavaBookmarkMarker.java

示例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);
}
 
开发者ID:germanattanasio,项目名称:traceability-assistant-eclipse-plugins,代码行数:13,代码来源:DXMIEditor.java

示例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;
            }
        }
    }
    // }
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:37,代码来源:AbstractMessagesEditor.java

示例7: gotoMarker

import org.eclipse.ui.ide.IDE; //导入方法依赖的package包/类
public void gotoMarker(IMarker marker) {
	setActivePage(0);
	IDE.gotoMarker(getEditor(0), marker);
}
 
开发者ID:dstl,项目名称:Open_Source_ECOA_Toolset_AS5,代码行数:5,代码来源:TypesEditor.java

示例8: gotoMarker

import org.eclipse.ui.ide.IDE; //导入方法依赖的package包/类
public void gotoMarker(IMarker marker) {
	setActivePage(pageIndex);
	IDE.gotoMarker(getEditor(pageIndex), marker);
}
 
开发者ID:insweat,项目名称:hssd,代码行数:5,代码来源:MultiPageEditorWithTextPage.java

示例9: gotoMarker

import org.eclipse.ui.ide.IDE; //导入方法依赖的package包/类
public void gotoMarker(IMarker marker) {
  setActivePage(0);
  IDE.gotoMarker(getEditor(0), marker);
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:5,代码来源:ActivitiMultiPageEditor.java

示例10: gotoMarker

import org.eclipse.ui.ide.IDE; //导入方法依赖的package包/类
public void gotoMarker(IMarker marker) {
	setActivePage(srcPage);
	IDE.gotoMarker(getEditor(srcPage), marker);
}
 
开发者ID:ploys,项目名称:ecle,代码行数:5,代码来源:MBDEditor.java

示例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;
                    }
                }
            }
//        }
    }
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:45,代码来源:MessagesEditor.java


注:本文中的org.eclipse.ui.ide.IDE.gotoMarker方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。