Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBogdan Gheorghe2006-07-26 17:50:29 +0000
committerBogdan Gheorghe2006-07-26 17:50:29 +0000
commitf810f84169eb8df7a7a6f0a8818f9f1978f97a93 (patch)
tree1ec5c94414e977ac2219b9e7e86b899de795e922
parenta87a33d8cea510d63a443c3cf36c8f9f70d37494 (diff)
downloadeclipse.platform.team-f810f84169eb8df7a7a6f0a8818f9f1978f97a93.tar.gz
eclipse.platform.team-f810f84169eb8df7a7a6f0a8818f9f1978f97a93.tar.xz
eclipse.platform.team-f810f84169eb8df7a7a6f0a8818f9f1978f97a93.zip
Bug 135063 [History View] API needed to give pages access to the view
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/GenericHistoryView.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/history/HistoryPage.java17
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/history/IHistoryPage.java19
3 files changed, 37 insertions, 1 deletions
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/GenericHistoryView.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/GenericHistoryView.java
index 0a6857042..384a8f828 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/GenericHistoryView.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/GenericHistoryView.java
@@ -455,6 +455,7 @@ public class GenericHistoryView extends ViewPart implements IHistoryView {
}
if (tempPageContainer != null) {
if (((IHistoryPage) tempPageContainer.getPage()).setInput(resource)){
+ ((HistoryPage) tempPageContainer.getPage()).setHistoryView(this);
setContentDescription(resource.getName());
showPageRec(tempPageContainer);
return (IHistoryPage) tempPageContainer.getPage();
@@ -491,6 +492,7 @@ public class GenericHistoryView extends ViewPart implements IHistoryView {
return pinnedPage;
if (((IHistoryPage) tempPageContainer.getPage()).setInput(object)){
+ ((HistoryPage) tempPageContainer.getPage()).setHistoryView(this);
setContentDescription(((IHistoryPage) tempPageContainer.getPage()).getName());
showPageRec(tempPageContainer);
return (IHistoryPage) tempPageContainer.getPage();
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/history/HistoryPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/history/HistoryPage.java
index 78400e01d..261f07a2b 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/history/HistoryPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/history/HistoryPage.java
@@ -24,6 +24,7 @@ public abstract class HistoryPage extends Page implements IHistoryPage, IAdaptab
private IHistoryPageSite site;
private Object input;
+ private IHistoryView historyView;
/* (non-Javadoc)
* @see org.eclipse.team.ui.history.IHistoryPage#setSite(org.eclipse.team.ui.history.IHistoryPageSite)
@@ -62,4 +63,20 @@ public abstract class HistoryPage extends Page implements IHistoryPage, IAdaptab
* @return <code>true</code> if the page was able to display the contents, <code>false</code> otherwise
*/
public abstract boolean inputSet();
+
+
+ public void setHistoryView(IHistoryView historyView){
+ this.historyView=historyView;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.history.IHistoryPage#getHistoryView()
+ */
+ public IHistoryView getHistoryView() {
+ if (historyView != null)
+ return historyView;
+
+ return null;
+ }
+
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/history/IHistoryPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/history/IHistoryPage.java
index 59c8af9c9..ed0ba98b5 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/history/IHistoryPage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/history/IHistoryPage.java
@@ -61,6 +61,7 @@ public interface IHistoryPage {
*
* @param object the object for which history is being requested for
* @return true if the page was able to display the history for the object, false otherwise
+ * @since 3.2
*/
public boolean setInput(Object object);
@@ -68,6 +69,7 @@ public interface IHistoryPage {
* Returns the object whose history is currently being displayed in the history page.
* @return object the object being displayed in the history page or <code>null</code>
* if no input has been set;
+ * @since 3.2
*/
public Object getInput();
@@ -75,17 +77,20 @@ public interface IHistoryPage {
* Returns true if this history page can show a history for the given object, false if it cannot
* @param object the object that is to have history shown
* @return boolean
+ * @since 3.2
*/
public boolean isValidInput(Object object);
/**
* Requests a refresh of the information presented by the history page.
+ * @since 3.2
*/
public void refresh();
/**
* Returns the name of the object whose history the page is showing
* @return String containing the name of the object
+ * @since 3.2
*/
public String getName();
@@ -96,6 +101,7 @@ public interface IHistoryPage {
* the user as tooltip text or by some other means.
* @return a one line description of the object whose history is
* being displayed or <code>null</code>
+ * @since 3.2
*/
public String getDescription();
@@ -104,19 +110,30 @@ public interface IHistoryPage {
* {@link IHistoryPageSite} in order to allow history pages to be displayed in
* both views and dialogs.
* @param site the history page site
+ * @since 3.2
*/
public void setSite(IHistoryPageSite site);
/**
* Returns the {@link IHistoryPageSite} set for this page.
* @return the history page site for this page
+ * @since 3.2
*/
public IHistoryPageSite getHistoryPageSite();
/**
* Called to allow IHistoryPage a chance to dispose of any widgets created
* for its page implementation
- *
+ * @since 3.2
*/
public void dispose();
+
+ /**
+ * Returns the {@link IHistoryView} instance that contains this history page or <em>null</em> if
+ * the history view instance cannot be determined.
+ * @return IHistoryView the history view that contains this history page or <em>null</em> if
+ * the history view instance cannot be determined.
+ * @since 3.3
+ */
+ public IHistoryView getHistoryView();
}

Back to the top