public void addExpressionRow(String expressionName) { RowData rowdata = (RowData) expressionGroup.getLayoutData(); rowdata.height += 120; expressionGroup.setLayoutData(new RowData(rowdata.width, rowdata.height)); Rectangle rect = expressionGroup.getBounds(); rect.height += 120; expressionGroup.setBounds(rect); /*Create a row*/ ExpressionBean expBean = expressions.get(new Integer(expCount - 1)); Label previousLabel = expBean.getLabel(); rect = previousLabel.getBounds(); Label lblNew = new Label(expressionGroup, SWT.NONE); lblNew.setBounds(10, rect.y + 90, 120, 15); lblNew.setText(expressionName); lblNew.setFocus(); Text previousText = expBean.getText(); rect = previousText.getBounds(); Text newText = new Text(expressionGroup, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL | SWT.MULTI); newText.setBounds(135, rect.y + 90, 550, 70); expressions.put(new Integer(expCount), new ExpressionBean(lblNew, newText)); expCount++; expScrolledComposite.setMinSize(expressionGroup.computeSize(SWT.DEFAULT, SWT.DEFAULT)); }
public void addNomenclatureRow(String name) { RowData rowdata = (RowData) nomenclatureGroup.getLayoutData(); rowdata.height += 30; nomenclatureGroup.setLayoutData(new RowData(rowdata.width, rowdata.height)); Rectangle rect = nomenclatureGroup.getBounds(); rect.height += 30; nomenclatureGroup.setBounds(rect); /*Create a row*/ NomenclatureBean nbean = nomenclatures.get(new Integer(nomenCount - 1)); Label previousLabel = nbean.getLabel(); rect = previousLabel.getBounds(); rect.y += 45; Label lblNew = new Label(nomenclatureGroup, SWT.NONE); lblNew.setBounds(rect); lblNew.setText(name); lblNew.setFocus(); /* Create the first group*/ Group prevGroup = nbean.getParent(); rect = prevGroup.getBounds(); Group group_1 = new Group(nomenclatureGroup, SWT.NONE); group_1.setBounds(100, rect.y + 45, 182, 40); Button buttonYes_1 = new Button(group_1, SWT.RADIO); buttonYes_1.setText("Yes"); buttonYes_1.setBounds(10, 13, 39, 16); Button buttonNo_1 = new Button(group_1, SWT.RADIO); buttonNo_1.setText("No"); buttonNo_1.setBounds(55, 13, 39, 16); Text text1 = new Text(group_1, SWT.BORDER); text1.setBounds(100, 11, 76, 21); nomenclatures.put( new Integer(nomenCount), new NomenclatureBean(group_1, buttonYes_1, buttonNo_1, text1, lblNew)); nomenCount++; /////////////////////////////////// /*Create the second group */ Group group_2 = new Group(nomenclatureGroup, SWT.NONE); group_2.setBounds(300, rect.y + 45, 182, 40); Button buttonYes_2 = new Button(group_2, SWT.RADIO); buttonYes_2.setText("Yes"); buttonYes_2.setBounds(10, 13, 39, 16); Button buttonNo_2 = new Button(group_2, SWT.RADIO); buttonNo_2.setText("No"); buttonNo_2.setBounds(55, 13, 39, 16); Text text2 = new Text(group_2, SWT.BORDER); text2.setBounds(100, 11, 76, 21); nomenclatures.put( new Integer(nomenCount), new NomenclatureBean(group_2, buttonYes_2, buttonNo_2, text2, lblNew)); nomenCount++; /* Create the third group */ Group group_3 = new Group(nomenclatureGroup, SWT.NONE); group_3.setBounds(500, rect.y + 45, 182, 40); Button buttonYes_3 = new Button(group_3, SWT.RADIO); buttonYes_3.setText("Yes"); buttonYes_3.setBounds(10, 13, 39, 16); Button buttonNo_3 = new Button(group_3, SWT.RADIO); buttonNo_3.setText("No"); buttonNo_3.setBounds(55, 13, 39, 16); Text text3 = new Text(group_3, SWT.BORDER); text3.setBounds(100, 11, 76, 21); nomenclatures.put( new Integer(nomenCount), new NomenclatureBean(group_3, buttonYes_3, buttonNo_3, text3, lblNew)); nomenCount++; nomenScrolledComposite.setMinSize(nomenclatureGroup.computeSize(SWT.DEFAULT, SWT.DEFAULT)); }
/* * (non-Javadoc) * * @see org.eclipse.ui.part.IPage#setFocus() */ public void setFocus() { fMessageLabel.setFocus(); }
public void setFocus() { label.setFocus(); }
@Override public void setFocus() { futureLabel.setFocus(); }