Java Code Examples for org.eclipse.team.ui.TeamUI#showHistoryFor()

The following examples show how to use org.eclipse.team.ui.TeamUI#showHistoryFor() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ShowHistoryHandler.java    From tlaplus with MIT License 5 votes vote down vote up
public static void openHistoryForModule(final Module module) {
	final IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
	if (activeWorkbenchWindow == null) {
		return;
	}
	
	final IHistoryView view
			= TeamUI.showHistoryFor(activeWorkbenchWindow.getActivePage(), module.getResource(), null);
	final IHistoryPage page = view.getHistoryPage();
	if (page instanceof LocalHistoryPage) {
		((LocalHistoryPage)page).setClickAction(true);
	}
}
 
Example 2
Source File: JavaCompareWithEditionActionImpl.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void run(ISelection selection) {

	IMember input= getEditionElement(selection);
	if (input == null) {
		MessageDialog.openInformation(getShell(), CompareMessages.CompareWithHistory_title, CompareMessages.CompareWithHistory_invalidSelectionMessage);
		return;
	}

	JavaElementHistoryPageSource pageSource = JavaElementHistoryPageSource.getInstance();
	final IFile file= pageSource.getFile(input);
	if (file == null) {
		MessageDialog.openError(getShell(), CompareMessages.CompareWithHistory_title, CompareMessages.CompareWithHistory_internalErrorMessage);
		return;
	}

	if (USE_MODAL_COMPARE) {
		CompareConfiguration cc = new CompareConfiguration();
		cc.setLeftEditable(false);
		cc.setRightEditable(false);
		HistoryPageCompareEditorInput ci = new HistoryPageCompareEditorInput(cc, pageSource, input);
		ci.setTitle(CompareMessages.JavaCompareWithEditionActionImpl_0);
		ci.setHelpContextId(IJavaHelpContextIds.COMPARE_ELEMENT_WITH_HISTORY_DIALOG);
		CompareUI.openCompareDialog(ci);
	} else {
		TeamUI.showHistoryFor(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(), input, pageSource);
	}
}