package tool.editors.cdf;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.part.ViewPart;
import tool.model.ToolClass.ClassProperty;
public class testvp extends ViewPart {
public static final String ID = "tool.editors.cdf.testvp"; //$NON-NLS-1$
private final FormToolkit toolkit = new FormToolkit(Display.getCurrent());
private Text classNameText;
private Text superClassText;
private Table propertiesTable;
public ClassProperty[] props;
public testvp() {
}
public ClassProperty[] getProps() {
return props;
}
public void setProps(ClassProperty[] props) {
this.props = props;
}
/**
* Create contents of the view part.
* @param parent
*/
@Override
public void createPartControl(Composite parent) {
Composite container = toolkit.createComposite(parent, SWT.NONE);
toolkit.paintBordersFor(container);
container.setLayout(new GridLayout(2, false));
{
Label lblName = new Label(container, SWT.NONE);
toolkit.adapt(lblName, true, true);
lblName.setText("Name");
}
{
classNameText = new Text(container, SWT.BORDER);
GridData gd_classNameText = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
gd_classNameText.widthHint = 112;
classNameText.setLayoutData(gd_classNameText);
classNameText.setBounds(0, 0, 64, 19);
toolkit.adapt(classNameText, true, true);
}
{
Label lblSuperClass = new Label(container, SWT.NONE);
lblSuperClass.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
toolkit.adapt(lblSuperClass, true, true);
lblSuperClass.setText("Super Class");
}
{
superClassText = new Text(container, SWT.BORDER);
superClassText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
toolkit.adapt(superClassText, true, true);
}
new Label(container, SWT.NONE);
{
propertiesTable = new Table(container, SWT.BORDER | SWT.FULL_SELECTION);
propertiesTable.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, true, 1, 1));
toolkit.adapt(propertiesTable);
toolkit.paintBordersFor(propertiesTable);
propertiesTable.setHeaderVisible(true);
propertiesTable.setLinesVisible(true);
{
TableColumn tblclmnName = new TableColumn(propertiesTable, SWT.NONE);
tblclmnName.setWidth(100);
tblclmnName.setText("Name");
}
{
TableColumn tblclmnAllow = new TableColumn(propertiesTable, SWT.NONE);
tblclmnAllow.setWidth(100);
tblclmnAllow.setText("Allow");
}
{
TableColumn tblclmnOverride = new TableColumn(propertiesTable, SWT.NONE);
tblclmnOverride.setWidth(100);
tblclmnOverride.setText("Override");
}
{
TableColumn tblclmnDefault = new TableColumn(propertiesTable, SWT.NONE);
tblclmnDefault.setWidth(100);
tblclmnDefault.setText("Default");
}
}
createActions();
initializeToolBar();
initializeMenu();
}
public void dispose() {
toolkit.dispose();
super.dispose();
}
/**
* Create the actions.
*/
private void createActions() {
// Create the actions
}
/**
* Initialize the toolbar.
*/
private void initializeToolBar() {
IToolBarManager tbm = getViewSite().getActionBars().getToolBarManager();
}
/**
* Initialize the menu.
*/
private void initializeMenu() {
IMenuManager manager = getViewSite().getActionBars().getMenuManager();
}
@Override
public void setFocus() {
// Set the focus
}
}