use of org.tigris.subversion.subclipse.ui.dialogs.HistorySearchDialog in project subclipse by subclipse.
the class SVNHistoryPage method inputSet.
public boolean inputSet() {
Object input = getInput();
if (input instanceof IResource) {
IResource res = (IResource) input;
RepositoryProvider teamProvider = RepositoryProvider.getProvider(res.getProject(), SVNProviderPlugin.getTypeId());
if (teamProvider != null) {
try {
ISVNLocalResource localResource = SVNWorkspaceRoot.getSVNResourceFor(res);
LocalResourceStatus localResourceStatus = (localResource != null) ? localResource.getStatus() : null;
if (localResource != null && localResourceStatus.isManaged() && (!localResourceStatus.isAdded() || localResourceStatus.isCopied())) {
this.resource = res;
this.remoteResource = localResource.getBaseResource();
this.projectProperties = ProjectProperties.getProjectProperties(res);
boolean includeBugs = projectProperties != null;
boolean includeTags = tagsPropertySet(res);
if (includeTags != this.includeTags || this.includeBugs != includeBugs) {
this.includeTags = includeTags;
this.includeBugs = includeBugs;
refreshTable();
}
this.historyTableProvider.setRemoteResource(this.remoteResource);
this.historyTableProvider.setProjectProperties(this.projectProperties);
if (historySearchViewerFilter != null) {
// HistorySearchViewerFilter[] filters = { historySearchViewerFilter };
// this.tableHistoryViewer.setFilters(filters);
this.tableHistoryViewer.resetFilters();
this.tableHistoryViewer.addFilter(historySearchViewerFilter);
historySearchDialog = new HistorySearchDialog(getSite().getShell(), remoteResource);
historySearchDialog.setSearchAll(false);
historySearchDialog.setStartRevision(historySearchViewerFilter.getStartRevision());
historySearchDialog.setEndRevision(historySearchViewerFilter.getEndRevision());
historySearchViewerFilter = null;
getClearSearchAction().setEnabled(true);
} else {
this.tableHistoryViewer.resetFilters();
getClearSearchAction().setEnabled(false);
}
this.tableHistoryViewer.setInput(this.remoteResource);
// setTitleToolTip(baseResource.getRepositoryRelativePath());
return true;
}
} catch (TeamException e) {
SVNUIPlugin.openError(getSite().getShell(), null, null, e);
}
}
} else if (input instanceof ISVNRemoteResource) {
this.resource = null;
this.remoteResource = (ISVNRemoteResource) input;
boolean includeTags = tagsPropertySet(remoteResource);
if (includeTags != this.includeTags) {
this.includeTags = includeTags;
refreshTable();
}
try {
this.projectProperties = ProjectProperties.getProjectProperties(this.remoteResource);
} catch (SVNException e) {
if (!e.operationInterrupted()) {
SVNUIPlugin.openError(getSite().getShell(), null, null, e);
}
}
boolean includeBugs = projectProperties != null;
if (includeTags != this.includeTags || this.includeBugs != includeBugs) {
this.includeTags = includeTags;
this.includeBugs = includeBugs;
refreshTable();
}
this.historyTableProvider.setRemoteResource(this.remoteResource);
this.historyTableProvider.setProjectProperties(this.projectProperties);
if (historySearchViewerFilter != null) {
// HistorySearchViewerFilter[] filters = { historySearchViewerFilter };
// this.tableHistoryViewer.setFilters(filters);
this.tableHistoryViewer.resetFilters();
this.tableHistoryViewer.addFilter(historySearchViewerFilter);
historySearchDialog = new HistorySearchDialog(getSite().getShell(), remoteResource);
historySearchDialog.setSearchAll(false);
historySearchDialog.setStartRevision(historySearchViewerFilter.getStartRevision());
historySearchDialog.setEndRevision(historySearchViewerFilter.getEndRevision());
historySearchViewerFilter = null;
getClearSearchAction().setEnabled(true);
} else {
this.tableHistoryViewer.resetFilters();
getClearSearchAction().setEnabled(false);
}
this.tableHistoryViewer.setInput(this.remoteResource);
// setTitleToolTip(remoteResource.getRepositoryRelativePath());
return true;
}
return false;
}
use of org.tigris.subversion.subclipse.ui.dialogs.HistorySearchDialog in project subclipse by subclipse.
the class SVNHistoryPage method getSearchAction.
// Search action (toolbar)
private IAction getSearchAction() {
if (searchAction == null) {
SVNUIPlugin plugin = SVNUIPlugin.getPlugin();
searchAction = new Action(Policy.bind("HistoryView.search"), // $NON-NLS-1$
plugin.getImageDescriptor(ISVNUIConstants.IMG_FILTER_HISTORY)) {
public void run() {
if (historySearchDialog == null) {
historySearchDialog = new HistorySearchDialog(getSite().getShell(), remoteResource);
}
historySearchDialog.setRemoteResource(remoteResource);
if (historySearchDialog.open() == Window.OK) {
searchAction.setEnabled(false);
Utils.schedule(new SearchHistoryJob(), SVNUIPlugin.getPlugin().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart().getSite());
}
}
};
searchAction.setDisabledImageDescriptor(plugin.getImageDescriptor(ISVNUIConstants.IMG_FILTER_HISTORY_DISABLED));
}
return searchAction;
}
Aggregations