01: /*******************************************************************************
02: * Copyright (c) 2004, 2005 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.examples.components.views.comparisons;
11:
12: import org.eclipse.swt.SWT;
13: import org.eclipse.swt.widgets.Composite;
14: import org.eclipse.swt.widgets.Label;
15: import org.eclipse.ui.internal.part.components.services.INameable;
16: import org.eclipse.ui.internal.part.components.services.IPluginResources;
17:
18: /**
19: * Sample view that sets its name, tooltip, image, and content description. The view
20: * uses a custom image supplied by its plugin.
21: *
22: * @since 3.1
23: */
24: public class NameViewNew {
25: public NameViewNew(Composite parent, INameable name,
26: IPluginResources images) {
27: name.setName("Name View (New)");
28: name.setContentDescription("content description");
29: name.setTooltip("This is a tooltip");
30: name.setImage(images.getImage("icons/sample.gif"));
31:
32: // Create some bogus view contents
33: Label content = new Label(parent, SWT.NONE);
34: content.setText("View contents go here");
35: }
36: }
|