Hi,
bei mir hats ein problem. Und zwar will ich, je nachdem was ausgewählt wurde, verschiedene Controls anzeigen. Nur wird mir nichts angezeigt. Soll so etwas anders gelöst werden?
Danke,
bei mir hats ein problem. Und zwar will ich, je nachdem was ausgewählt wurde, verschiedene Controls anzeigen. Nur wird mir nichts angezeigt. Soll so etwas anders gelöst werden?
Danke,
Java:
private void createDisplayCombo(final Group valueGroup) {
Combo comboSelection = new Combo(valueGroup, SWT.SIMPLE | SWT.DROP_DOWN
| SWT.READ_ONLY);
//selection1
comboSelection.add(ComboSelectionEnum.Anzeige.toString());
//selection2
comboSelection.add(ComboSelectionEnum.Wert.toString());
//selection3
comboSelection.add(ComboSelectionEnum.Bewegung.toString());
comboSelection.setText(ComboSelectionEnum.Anzeige.toString());
comboSelection.addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent e) {
String displayType = ((Combo)e.getSource()).getText();
if(displayType.equals(ComboSelectionEnum.Anzeige.toString())){
/*
* COMBO - DISPLAY
*/
createDisplayRow(valueGroup);
}
if(displayType.equals(ComboSelectionEnum.Wert.toString())){
/*
* COMBO - VALUE
*/
createValueRow(valueGroup);
}
if(displayType.equals(ComboSelectionEnum.Bewegung.toString())){
/*
* COMBO - BEWEGUNG
*/
createMovementRow(valueGroup);
}
}
@Override
public void widgetDefaultSelected(SelectionEvent e) {
// TODO Auto-generated method stub
}
});
}
private void createMovementRow(Group valueGroup) {
}
private void createValueRow(Group valueGroup) {
GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
/**
* Group ValueGroup -
* Combo Wert
*/
Combo combo = new Combo(valueGroup, SWT.SIMPLE | SWT.DROP_DOWN
| SWT.READ_ONLY);
combo.add("=");
combo.add("<>");
combo.add("><");
combo.setText("=");
/**
* Group ValueGroup -
* Text Wert von
*/
Text display_Value_start = new Text(valueGroup, SWT.BORDER | SWT.FILL);
display_Value_start.setText("Wert von");
gridData = new GridData(GridData.FILL_HORIZONTAL);
gridData.horizontalSpan = 1;
gridData.grabExcessHorizontalSpace = true;
display_Value_start.setLayoutData(gridData);
/**
* Group ValueGroup -
* Text Wert bis
*/
Text display_Value_end = new Text(valueGroup, SWT.BORDER | SWT.FILL);
display_Value_end.setText("bis");
gridData = new GridData(GridData.FILL_HORIZONTAL);
gridData.horizontalSpan = 1;
gridData.grabExcessHorizontalSpace = true;
display_Value_end.setLayoutData(gridData);
/**
* Group ValueGroup -
* Text Eigenschaft
*/
Text display_Property = new Text(valueGroup, SWT.BORDER | SWT.FILL);
display_Property.setText("Eigenschaft");
gridData = new GridData(GridData.FILL_HORIZONTAL);
gridData.horizontalSpan = 1;
gridData.grabExcessHorizontalSpace = true;
display_Property.setLayoutData(gridData);
/**
* Group ValueGroup -
* Text Wert
*/
Text display_Value = new Text(valueGroup, SWT.BORDER | SWT.FILL);
display_Property.setText("Eigenschaft");
gridData = new GridData(GridData.FILL_HORIZONTAL);
gridData.horizontalSpan = 1;
gridData.grabExcessHorizontalSpace = true;
display_Value.setLayoutData(gridData);
}
private void createDisplayRow(Composite composite) {
//GridData
GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
/*
* Group ValueGroup -
* Text Format
*/
Text displayText = new Text(composite, SWT.BORDER | SWT.FILL);
displayText.setText("TEST");
gridData.horizontalSpan = 5;
displayText.setLayoutData(gridData);
}