summaryrefslogtreecommitdiff
path: root/propertysheet/src/org/eclipse/wb/internal/core/editor/structure/IPage.java
blob: a86522d843818be1395f1e019d6ccc43bf090532 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*******************************************************************************
 * Copyright (c) 2011 Google, Inc.
 * 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:
 *    Google, Inc. - initial API and implementation
 *******************************************************************************/
package org.eclipse.wb.internal.core.editor.structure;

import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;

/**
 * View-like page.
 * 
 * @author scheglov_ke
 * @coverage core.editor.structure
 */
public interface IPage {
  /**
   * Creates the {@link Control} for this page.
   */
  void createControl(Composite parent);

  /**
   * Disposes this page.
   * <p>
   * This is the last method called on the {@link IPage}. Implementors should clean up any resources
   * associated with the page.
   * <p>
   * Note that there is no guarantee that {@link #createControl(Composite)} has been called, so the
   * control may never have been created.
   */
  void dispose();

  /**
   * @return the {@link Control} of this page, may be <code>null</code>.
   */
  Control getControl();

  /**
   * Allows the page to make contributions to the given {@link IToolBarManager}. The contributions
   * will be visible when the page is visible. This method is automatically called shortly after
   * {@link #createControl(Composite)} is called.
   */
  void setToolBar(IToolBarManager toolBarManager);

  /**
   * Asks this page to take focus.
   */
  void setFocus();
}