/** * @see org.eclipse.ui.views.properties.tabbed.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite, * org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage) */ public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) { super.createControls(parent, tabbedPropertySheetPage); parentComposite = getWidgetFactory().createFlatFormComposite(parent); FormData data; text = createText(parentComposite, ""); //$NON-NLS-1$ CLabel nameLabel = getWidgetFactory().createCLabel(parentComposite, getLabelText()); data = new FormData(); data.left = new FormAttachment(0, 0); data.right = new FormAttachment(text, -ITabbedPropertyConstants.HSPACE); data.top = new FormAttachment(text, 0, SWT.CENTER); nameLabel.setLayoutData(data); listener = new TextChangeHelper() { public void textChanged(Control control) { handleTextModified(); } }; listener.startListeningTo(text); if (fireChangeOnEnter()) listener.startListeningForEnter(text); }
private void createNameLabel(Composite parent) { this.nameLabel = getWidgetFactory().createCLabel(parent, "列名:"); FormData data = new FormData(); data.top = new FormAttachment(nameText, 0, SWT.CENTER); data.left = new FormAttachment(0, 0); data.right = new FormAttachment(nameText, -ITabbedPropertyConstants.HSPACE); this.nameLabel.setLayoutData(data); }
private void createLabelLabel(Composite parent) { this.labelLabel = getWidgetFactory().createCLabel(parent, "名称:"); FormData data = new FormData(); data.top = new FormAttachment(labelText, 0, SWT.CENTER); data.left = new FormAttachment(0, 0); data.right = new FormAttachment(labelText, -ITabbedPropertyConstants.HSPACE); this.labelLabel.setLayoutData(data); }
private void createCommentLabel(Composite parent) { this.commentLabel = getWidgetFactory().createCLabel(parent, "备注:"); FormData data = new FormData(); data.top = new FormAttachment(commentText, 0, SWT.CENTER); data.left = new FormAttachment(0, 0); data.right = new FormAttachment(commentText, -ITabbedPropertyConstants.HSPACE); this.commentLabel.setLayoutData(data); }
private void createConstraintNameLabel(Composite parent) { this.constraintNameLabel = getWidgetFactory().createCLabel(parent, "约束名称:"); FormData data = new FormData(); data.top = new FormAttachment(constraintNameText, 0, SWT.CENTER); data.left = new FormAttachment(0, 0); data.right = new FormAttachment(constraintNameText, -ITabbedPropertyConstants.HSPACE); this.constraintNameLabel.setLayoutData(data); }
private void createPkColumnNameLabel(Composite parent) { this.pkColumnNameLabel = getWidgetFactory().createCLabel(parent, "主键名称:"); FormData data = new FormData(); data.top = new FormAttachment(pkColumnNameText, 0, SWT.CENTER); data.left = new FormAttachment(0, 0); data.right = new FormAttachment(pkColumnNameText, -ITabbedPropertyConstants.HSPACE); this.pkColumnNameLabel.setLayoutData(data); }
private void createFkColumnNameLabel(Composite parent) { this.fkColumnNameLabel = getWidgetFactory().createCLabel(parent, "外键名称:"); FormData data = new FormData(); data.top = new FormAttachment(fkColumnNameText, 0, SWT.CENTER); data.left = new FormAttachment(0, 0); data.right = new FormAttachment(fkColumnNameText, -ITabbedPropertyConstants.HSPACE); this.fkColumnNameLabel.setLayoutData(data); }
private void createTypeLabel(Composite parent) { this.typeLabel = getWidgetFactory().createCLabel(parent, "对应关系:"); FormData data = new FormData(); data.top = new FormAttachment(typeCombo, 0, SWT.CENTER); data.left = new FormAttachment(0, 0); data.right = new FormAttachment(typeCombo, -ITabbedPropertyConstants.HSPACE); this.typeLabel.setLayoutData(data); }
private void createTypeLabel(Composite parent) { this.typeLabel = getWidgetFactory().createCLabel(parent, "类型:"); FormData data = new FormData(); data.top = new FormAttachment(typeCombo, 0, SWT.CENTER); data.left = new FormAttachment(0, 0); data.right = new FormAttachment(typeCombo, -ITabbedPropertyConstants.HSPACE); this.typeLabel.setLayoutData(data); }
private void createLengthLabel(Composite parent) { this.lengthLabel = getWidgetFactory().createCLabel(parent, "长度:"); FormData data = new FormData(); data.top = new FormAttachment(lengthText, 0, SWT.CENTER); data.left = new FormAttachment(0, 0); data.right = new FormAttachment(lengthText, -ITabbedPropertyConstants.HSPACE); this.lengthLabel.setLayoutData(data); }
private void createDecimalLengthLabel(Composite parent) { this.decimalLengthLabel = getWidgetFactory().createCLabel(parent, "小数位:"); FormData data = new FormData(); data.top = new FormAttachment(decimalLengthText, 0, SWT.CENTER); data.left = new FormAttachment(0, 0); data.right = new FormAttachment(decimalLengthText, -ITabbedPropertyConstants.HSPACE); this.decimalLengthLabel.setLayoutData(data); }
private void createDefaultValueLabel(Composite parent) { this.defaultValueLabel = getWidgetFactory().createCLabel(parent, "默认值:"); FormData data = new FormData(); data.top = new FormAttachment(defaultValueText, 0, SWT.CENTER); data.left = new FormAttachment(0, 0); data.right = new FormAttachment(defaultValueText, -ITabbedPropertyConstants.HSPACE); this.defaultValueLabel.setLayoutData(data); }
private void createDbTypeLabel(Composite parent) { this.dbTypeLabel = getWidgetFactory().createCLabel(parent, "数据库:"); FormData data = new FormData(); data.top = new FormAttachment(dbTypeText, 0, SWT.CENTER); data.left = new FormAttachment(0, 0); data.right = new FormAttachment(dbTypeText, -ITabbedPropertyConstants.HSPACE); this.dbTypeLabel.setLayoutData(data); }
@Override public int estimateRowSize(Composite subComposite, IElementParameter param) { final DecoratedField dField = new DecoratedField(subComposite, SWT.BORDER, new IControlCreator() { public Control createControl(Composite parent, int style) { return getWidgetFactory().createButton(parent, EParameterName.ROUTE_RESOURCE_TYPE.getDisplayName(), SWT.None); } }); Point initialSize = dField.getLayoutControl().computeSize(SWT.DEFAULT, SWT.DEFAULT); dField.getLayoutControl().dispose(); return initialSize.y + ITabbedPropertyConstants.VSPACE; }
/** * @see org.eclipse.ui.views.properties.tabbed.ISection#createControls(org.eclipse.swt.widgets.Composite, * org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage) */ public void createControls(Composite parent, TabbedPropertySheetPage aTabbedPropertySheetPage) { super.createControls(parent, aTabbedPropertySheetPage); Composite composite = getWidgetFactory().createFlatFormComposite(parent); FormData data; combo = getWidgetFactory().createCCombo(composite); data = new FormData(); data.left = new FormAttachment(0, getStandardLabelWidth(composite, new String[] { getLabelText() })); data.right = new FormAttachment(100, 0); data.top = new FormAttachment(0, ITabbedPropertyConstants.VSPACE); combo.setLayoutData(data); CLabel nameLabel = getWidgetFactory().createCLabel(composite, getLabelText()); data = new FormData(); data.left = new FormAttachment(0, 0); data.right = new FormAttachment(combo, -ITabbedPropertyConstants.HSPACE); data.top = new FormAttachment(combo, 0, SWT.CENTER); nameLabel.setLayoutData(data); combo.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent event) { handleComboModified(); } }); }
protected Text createText(Composite composite, String value) { Text text = getWidgetFactory().createText(composite, value, SWT.MULTI | SWT.WRAP); FormData data = new FormData(); data.height = 75; data.width = composite.getBounds().width; data.left = new FormAttachment(0, getStandardLabelWidth(composite, new String[] { getLabelText() })); data.right = new FormAttachment(100, 0); data.top = new FormAttachment(0, ITabbedPropertyConstants.VSPACE); text.setLayoutData(data); return text; }
protected Text createText(Composite composite, String value) { Text text = getWidgetFactory().createText(composite, value); FormData data = new FormData(); data.left = new FormAttachment(0, getStandardLabelWidth(composite, new String[] { getLabelText() })); data.right = new FormAttachment(100, 0); data.top = new FormAttachment(0, ITabbedPropertyConstants.VSPACE); text.setLayoutData(data); return text; }
public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) { super.createControls(parent, tabbedPropertySheetPage); Composite parentComposite = getWidgetFactory().createFlatFormComposite(parent); combo = getWidgetFactory().createCCombo(parentComposite); combo.setItems(getList()); combo.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { itemSelected(combo.getSelectionIndex()); } }); CLabel nameLabel = getWidgetFactory().createCLabel(parentComposite, getLabelText()); FormData data = new FormData(); data.left = new FormAttachment(0, 0); data.right = new FormAttachment(combo, -ITabbedPropertyConstants.HSPACE); data.top = new FormAttachment(combo, 0, SWT.CENTER); nameLabel.setLayoutData(data); data = new FormData(); data.left = new FormAttachment(0, getStandardLabelWidth(parent, new String[] { getLabelText() })); data.right = new FormAttachment(100, 0); data.top = new FormAttachment(0, ITabbedPropertyConstants.VSPACE); combo.setLayoutData(data); }
@Override public Control createControl(Composite subComposite, IElementParameter param, int numInRow, int nbInRow, int top, Control lastControl) { Button theBtn = getWidgetFactory().createButton(subComposite, "", SWT.PUSH); //$NON-NLS-1$ theBtn.setBackground(subComposite.getBackground()); if (param.getDisplayName().equals("")) { //$NON-NLS-1$ theBtn.setImage(ImageProvider.getImage(CoreUIPlugin.getImageDescriptor(DOTS_BUTTON))); } else { theBtn.setText(param.getDisplayName()); } FormData data = new FormData(); if (isInWizard()) { if (lastControl != null) { data.right = new FormAttachment(lastControl, 0); } else { data.right = new FormAttachment(100, -ITabbedPropertyConstants.HSPACE); } } else { if (lastControl != null) { data.left = new FormAttachment(lastControl, 0); } else { data.left = new FormAttachment((((numInRow - 1) * MAX_PERCENT) / nbInRow), 0); } } data.top = new FormAttachment(0, top); theBtn.setLayoutData(data); theBtn.setEnabled(!param.isReadOnly()); theBtn.setData(param); hashCurControls.put(param.getName(), theBtn); theBtn.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { Command cmd = createCommand((Button) e.getSource()); executeCommand(cmd); } }); Point initialSize = theBtn.computeSize(SWT.DEFAULT, SWT.DEFAULT); dynamicProperty.setCurRowSize(initialSize.y + ITabbedPropertyConstants.VSPACE); if (nexusServerBean == null) { theBtn.setVisible(false); } Display.getDefault().asyncExec(new Runnable() { @Override public void run() { refresh(param, true); } }); return theBtn; }