Home | History | Annotate | Download | only in structure
      1 /*******************************************************************************
      2  * Copyright (c) 2011 Google, Inc.
      3  * All rights reserved. This program and the accompanying materials
      4  * are made available under the terms of the Eclipse Public License v1.0
      5  * which accompanies this distribution, and is available at
      6  * http://www.eclipse.org/legal/epl-v10.html
      7  *
      8  * Contributors:
      9  *    Google, Inc. - initial API and implementation
     10  *******************************************************************************/
     11 package org.eclipse.wb.internal.core.editor.structure;
     12 
     13 import org.eclipse.jface.action.IToolBarManager;
     14 import org.eclipse.swt.widgets.Composite;
     15 import org.eclipse.swt.widgets.Control;
     16 
     17 /**
     18  * View-like page.
     19  *
     20  * @author scheglov_ke
     21  * @coverage core.editor.structure
     22  */
     23 public interface IPage {
     24   /**
     25    * Creates the {@link Control} for this page.
     26    */
     27   void createControl(Composite parent);
     28 
     29   /**
     30    * Disposes this page.
     31    * <p>
     32    * This is the last method called on the {@link IPage}. Implementors should clean up any resources
     33    * associated with the page.
     34    * <p>
     35    * Note that there is no guarantee that {@link #createControl(Composite)} has been called, so the
     36    * control may never have been created.
     37    */
     38   void dispose();
     39 
     40   /**
     41    * @return the {@link Control} of this page, may be <code>null</code>.
     42    */
     43   Control getControl();
     44 
     45   /**
     46    * Allows the page to make contributions to the given {@link IToolBarManager}. The contributions
     47    * will be visible when the page is visible. This method is automatically called shortly after
     48    * {@link #createControl(Composite)} is called.
     49    */
     50   void setToolBar(IToolBarManager toolBarManager);
     51 
     52   /**
     53    * Asks this page to take focus.
     54    */
     55   void setFocus();
     56 }
     57