01: /*******************************************************************************
02: * Copyright (c) 2003, 2006 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.pde.internal.ui.editor;
11:
12: import org.eclipse.jface.viewers.ISelection;
13: import org.eclipse.swt.dnd.Clipboard;
14: import org.eclipse.swt.layout.GridData;
15: import org.eclipse.swt.widgets.Composite;
16: import org.eclipse.swt.widgets.Control;
17: import org.eclipse.swt.widgets.Label;
18: import org.eclipse.ui.forms.AbstractFormPart;
19: import org.eclipse.ui.forms.IDetailsPage;
20: import org.eclipse.ui.forms.widgets.FormToolkit;
21:
22: public abstract class PDEDetails extends AbstractFormPart implements
23: IDetailsPage, IContextPart {
24:
25: public PDEDetails() {
26: }
27:
28: public boolean canPaste(Clipboard clipboard) {
29: return true;
30: }
31:
32: /**
33: * @param selection
34: * @return
35: */
36: public boolean canCopy(ISelection selection) {
37: // Sub-classes to override
38: return false;
39: }
40:
41: /**
42: * @param selection
43: * @return
44: */
45: public boolean canCut(ISelection selection) {
46: // Sub-classes to override
47: return false;
48: }
49:
50: public boolean doGlobalAction(String actionId) {
51: return false;
52: }
53:
54: protected void markDetailsPart(Control control) {
55: control.setData("part", this ); //$NON-NLS-1$
56: }
57:
58: protected void createSpacer(FormToolkit toolkit, Composite parent,
59: int span) {
60: Label spacer = toolkit.createLabel(parent, ""); //$NON-NLS-1$
61: GridData gd = new GridData();
62: gd.horizontalSpan = span;
63: spacer.setLayoutData(gd);
64: }
65:
66: public void cancelEdit() {
67: super.refresh();
68: }
69: }
|