All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.eclipse.ui.part.Page Maven / Gradle / Ivy

Go to download

This plug-in contains the bulk of the Workbench implementation, and depends on JFace, SWT, and Core Runtime. It cannot be used independently from org.eclipse.ui. Workbench client plug-ins should not depend directly on this plug-in.

The newest version!
/*******************************************************************************
 * Copyright (c) 2000, 2006 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.ui.part;

import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IStatusLineManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.IActionBars;

/**
 * Abstract base superclass for pages in a pagebook view.
 * 

* This class should be subclassed by clients wishing to define new types * of pages for multi-page views. *

*

* Subclasses must implement the following methods: *

    *
  • createControl - to create the page's control
  • *
  • getControl - to retrieve the page's control
  • *
*

*

* Subclasses may extend or reimplement the following methods as required: *

    *
  • dispose - extend to provide additional cleanup
  • *
  • setFocus - reimplement to accept focus
  • *
  • setActionBars - reimplement to make contributions
  • *
  • makeContributions - this method exists to support previous versions
  • *
  • setActionBars - this method exists to support previous versions
  • *
  • init - extend to provide additional setup
  • *
*

* * @see PageBookView */ public abstract class Page implements IPageBookViewPage { /** * The site which contains this page */ private IPageSite site; /* * Creates a new page for a pagebook view. */ protected Page() { } /* (non-Javadoc) * Method declared on IPage. */ public abstract void createControl(Composite parent); /** * The Page implementation of this IPage method * disposes of this page's control (if it has one and it has not already * been disposed). Subclasses may extend. */ public void dispose() { Control ctrl = getControl(); if (ctrl != null && !ctrl.isDisposed()) { ctrl.dispose(); } } /** * The Page implementation of this IPage method returns * null. Subclasses must reimplement. */ public abstract Control getControl(); /* (non-Javadoc) * This method exists for backward compatibility. * Subclasses should reimplement init. */ public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) { } /* (non-Javadoc) * This method exists for backward compatibility. * Subclasses should reimplement init. */ public void setActionBars(IActionBars actionBars) { makeContributions(actionBars.getMenuManager(), actionBars .getToolBarManager(), actionBars.getStatusLineManager()); } /** * The Page implementation of this IPageBookViewPage method * stores a reference to the supplied site (the site which contains this * page). *

* Subclasses may extend. *

* * @since 2.0 */ public void init(IPageSite pageSite) { site = pageSite; } /** * Returns the site which contains this page. * * @return the site which contains this page */ public IPageSite getSite() { return site; } /** * The Page implementation of this IPage method * does nothing. Subclasses must implement. */ public abstract void setFocus(); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy