當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。