コード例 #1
0
  private Composite buildUIForSpecific(Composite parent) {
    Composite container = new Composite(parent, SWT.NONE);
    container.setLayoutData(new GridData(GridData.FILL_BOTH));
    GridLayout layout = new GridLayout(3, false);
    container.setLayout(layout);

    ReportEngine engine = new ReportEngine(new EngineConfig());
    String[] typeInfo = engine.getSupportedFormats();
    specCheckButtons = new HashMap();
    specExpressions = new HashMap();
    for (int i = 0; i < typeInfo.length; i++) {
      Button btn =
          FormWidgetFactory.getInstance().createButton(container, SWT.CHECK, isFormStyle());
      btn.setText(typeInfo[i]);
      btn.setSelection(false);

      Label label = FormWidgetFactory.getInstance().createLabel(container, isFormStyle());
      label.setText(Messages.getString("VisibilityPage.Label.Expression")); // $NON-NLS-1$

      ExpressionComposite expression = new ExpressionComposite(container, isFormStyle());
      GridData data = new GridData();
      data.grabExcessHorizontalSpace = true;
      data.horizontalAlignment = GridData.FILL;
      expression.setLayoutData(data);

      specCheckButtons.put(typeInfo[i], btn);
      specExpressions.put(typeInfo[i], expression);

      btn.addSelectionListener(listener);
      expression.addListener(
          SWT.Modify,
          new Listener() {

            public void handleEvent(Event event) {
              saveHideInfo();
            }
          });
    }

    return container;
  }