diff options
author | Andre Weinand | 2004-02-09 11:43:42 +0000 |
---|---|---|
committer | Andre Weinand | 2004-02-09 11:43:42 +0000 |
commit | c5adec880cf4adb96cc5269a98e2d54f51a14a84 (patch) | |
tree | fb312c2c845027b03e7a6e89566f771280ea7577 | |
parent | c3c7a1f18f1a98ef331b2f29c19b146e0f23afe7 (diff) | |
download | eclipse.platform.team-c5adec880cf4adb96cc5269a98e2d54f51a14a84.tar.gz eclipse.platform.team-c5adec880cf4adb96cc5269a98e2d54f51a14a84.tar.xz eclipse.platform.team-c5adec880cf4adb96cc5269a98e2d54f51a14a84.zip |
added support for outline view
2 files changed, 212 insertions, 0 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareOutlinePage.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareOutlinePage.java new file mode 100644 index 000000000..6a286e8e3 --- /dev/null +++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareOutlinePage.java @@ -0,0 +1,106 @@ +/******************************************************************************* + * Copyright (c) 2000, 2003 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.compare.internal; + +import org.eclipse.ui.IActionBars; +import org.eclipse.ui.views.contentoutline.IContentOutlinePage; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.*; + +import org.eclipse.jface.util.ListenerList; +import org.eclipse.jface.viewers.*; + +import org.eclipse.compare.CompareEditorInput; + +/** + */ +public class CompareOutlinePage implements IContentOutlinePage { + + private Control fControl; + private ListenerList fListeners= new ListenerList(); + private ISelection fSelection; + private IActionBars fActionBars; + private CompareEditorInput fCompareEditorInput; + + CompareOutlinePage(CompareEditorInput input) { + fCompareEditorInput= input; + } + + /* (non-Javadoc) + * @see org.eclipse.ui.part.IPage#createControl(org.eclipse.swt.widgets.Composite) + */ + public void createControl(Composite parent) { + if (fCompareEditorInput != null) { + fControl= fCompareEditorInput.createHierarchy(parent, SWT.VERTICAL); + } + } + + /* (non-Javadoc) + * @see org.eclipse.ui.part.IPage#dispose() + */ + public void dispose() { + if (fControl != null) + fControl.dispose(); + } + + /* (non-Javadoc) + * @see org.eclipse.ui.part.IPage#getControl() + */ + public Control getControl() { + return fControl; + } + + /* (non-Javadoc) + * @see org.eclipse.ui.part.IPage#setActionBars(org.eclipse.ui.IActionBars) + */ + public void setActionBars(IActionBars actionBars) { + fActionBars= actionBars; + if (fControl != null) + fControl.setData("actionBars", actionBars); + } + + /* (non-Javadoc) + * @see org.eclipse.ui.part.IPage#setFocus() + */ + public void setFocus() { + if (fControl != null) + fControl.setFocus(); + } + + /* (non-Javadoc) + * @see org.eclipse.jface.viewers.ISelectionProvider#addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) + */ + public void addSelectionChangedListener(ISelectionChangedListener listener) { + fListeners.add(listener); + } + + /* (non-Javadoc) + * @see org.eclipse.jface.viewers.ISelectionProvider#getSelection() + */ + public ISelection getSelection() { + return fSelection; + } + + /* (non-Javadoc) + * @see org.eclipse.jface.viewers.ISelectionProvider#removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) + */ + public void removeSelectionChangedListener(ISelectionChangedListener listener) { + fListeners.remove(listener); + } + + /* (non-Javadoc) + * @see org.eclipse.jface.viewers.ISelectionProvider#setSelection(org.eclipse.jface.viewers.ISelection) + */ + public void setSelection(ISelection selection) { + fSelection= selection; + } +} diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareOutlinePage.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareOutlinePage.java new file mode 100644 index 000000000..6a286e8e3 --- /dev/null +++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareOutlinePage.java @@ -0,0 +1,106 @@ +/******************************************************************************* + * Copyright (c) 2000, 2003 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.compare.internal; + +import org.eclipse.ui.IActionBars; +import org.eclipse.ui.views.contentoutline.IContentOutlinePage; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.*; + +import org.eclipse.jface.util.ListenerList; +import org.eclipse.jface.viewers.*; + +import org.eclipse.compare.CompareEditorInput; + +/** + */ +public class CompareOutlinePage implements IContentOutlinePage { + + private Control fControl; + private ListenerList fListeners= new ListenerList(); + private ISelection fSelection; + private IActionBars fActionBars; + private CompareEditorInput fCompareEditorInput; + + CompareOutlinePage(CompareEditorInput input) { + fCompareEditorInput= input; + } + + /* (non-Javadoc) + * @see org.eclipse.ui.part.IPage#createControl(org.eclipse.swt.widgets.Composite) + */ + public void createControl(Composite parent) { + if (fCompareEditorInput != null) { + fControl= fCompareEditorInput.createHierarchy(parent, SWT.VERTICAL); + } + } + + /* (non-Javadoc) + * @see org.eclipse.ui.part.IPage#dispose() + */ + public void dispose() { + if (fControl != null) + fControl.dispose(); + } + + /* (non-Javadoc) + * @see org.eclipse.ui.part.IPage#getControl() + */ + public Control getControl() { + return fControl; + } + + /* (non-Javadoc) + * @see org.eclipse.ui.part.IPage#setActionBars(org.eclipse.ui.IActionBars) + */ + public void setActionBars(IActionBars actionBars) { + fActionBars= actionBars; + if (fControl != null) + fControl.setData("actionBars", actionBars); + } + + /* (non-Javadoc) + * @see org.eclipse.ui.part.IPage#setFocus() + */ + public void setFocus() { + if (fControl != null) + fControl.setFocus(); + } + + /* (non-Javadoc) + * @see org.eclipse.jface.viewers.ISelectionProvider#addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) + */ + public void addSelectionChangedListener(ISelectionChangedListener listener) { + fListeners.add(listener); + } + + /* (non-Javadoc) + * @see org.eclipse.jface.viewers.ISelectionProvider#getSelection() + */ + public ISelection getSelection() { + return fSelection; + } + + /* (non-Javadoc) + * @see org.eclipse.jface.viewers.ISelectionProvider#removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) + */ + public void removeSelectionChangedListener(ISelectionChangedListener listener) { + fListeners.remove(listener); + } + + /* (non-Javadoc) + * @see org.eclipse.jface.viewers.ISelectionProvider#setSelection(org.eclipse.jface.viewers.ISelection) + */ + public void setSelection(ISelection selection) { + fSelection= selection; + } +} |