blob: 0b91ae3d553238ca2f1463f82995ce14aaac35a8 (
plain) (
blame)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
/*******************************************************************************
* Copyright (c) 2004, 2008 John Krasnay 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:
* John Krasnay - initial API and implementation
*******************************************************************************/
package org.eclipse.wst.xml.vex.ui.internal.views;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.part.IPage;
import org.eclipse.ui.part.IPageBookViewPage;
import org.eclipse.ui.part.IPageSite;
import org.eclipse.ui.part.PageBook;
import org.eclipse.ui.part.PageBookView;
import org.eclipse.wst.xml.vex.ui.internal.editor.Messages;
import org.eclipse.wst.xml.vex.ui.internal.editor.VexEditor;
/**
* A view that shows stats about the current Vex editor as a debugging aid.
*/
public class DebugView extends PageBookView {
protected IPage createDefaultPage(PageBook book) {
IPageBookViewPage page = new IPageBookViewPage() {
public void createControl(Composite parent) {
this.label = new Label(parent, SWT.NONE);
this.label.setText(Messages
.getString("DebugView.noActiveEditor")); //$NON-NLS-1$
}
public void dispose() {
}
public Control getControl() {
return this.label;
}
public IPageSite getSite() {
return this.site;
}
public void init(IPageSite site) throws PartInitException {
this.site = site;
}
public void setActionBars(IActionBars actionBars) {
}
public void setFocus() {
}
private IPageSite site;
private Label label;
};
initPage(page);
page.createControl(getPageBook());
return page;
}
protected PageRec doCreatePage(IWorkbenchPart part) {
DebugViewPage page = new DebugViewPage((VexEditor) part);
initPage(page);
page.createControl(getPageBook());
return new PageRec(part, page);
}
protected void doDestroyPage(IWorkbenchPart part, PageRec pageRecord) {
pageRecord.page.dispose();
}
protected IWorkbenchPart getBootstrapPart() {
// TODO Auto-generated method stub
return null;
}
protected boolean isImportant(IWorkbenchPart part) {
return (part instanceof VexEditor);
}
}
|