private IContainerContentCreator createDelayFieldCreator() {
    final IBluePrintFactory bpf = Toolkit.getBluePrintFactory();
    return new IContainerContentCreator() {

      @Override
      public void createContent(final IContainer container) {
        container.setLayout(
            new MigLayoutDescriptor("[][100!]", "0[]0")); // $NON-NLS-1$ //$NON-NLS-2$
        container.add(
            bpf.textLabel(Messages.getString("UserTableView.delay")),
            ""); //$NON-NLS-1$ //$NON-NLS-2$
        delayField = container.add(bpf.inputFieldIntegerNumber(), "w 100!"); // $NON-NLS-1$
        delayField.setValue(parameter.get());
        delayField.addInputListener(
            new IInputListener() {
              @Override
              public void inputChanged() {
                parameter.set(delayField.getValue());
              }
            });
      }

      @Override
      public void containerDisposed(final IContainer container) {}
    };
  }
 private IAction createPackAction() {
   final IActionBuilder builder = Toolkit.getActionBuilderFactory().create();
   builder.setText(Messages.getString("UserTableView.pack")); // $NON-NLS-1$
   builder.setIcon(SilkIcons.ARROW_INOUT);
   builder.setCommand(
       new ICommandExecutor() {
         @Override
         public void execute(final IExecutionContext executionContext) throws Exception {
           table.pack();
         }
       });
   return builder.build();
 }
Exemplo n.º 3
0
 @Override
 public void onClose(final IVetoable vetoable) {
   final QuestionResult result =
       Toolkit.getQuestionPane()
           .askYesNoQuestion("Would you really like to quit the application?");
   if (result != QuestionResult.YES) {
     vetoable.veto();
   } else {
     final ITrayItem trayItem = context.getWorkbenchContext().getTrayItem();
     if (trayItem != null) {
       trayItem.showWarning("Application closed", "You really have closed the application!");
     }
   }
 }
 private IAction createClearAction() {
   final IActionBuilder builder = Toolkit.getActionBuilderFactory().create();
   builder
       .setText(Messages.getString("UserTableView.clear"))
       .setToolTipText(
           Messages.getString("UserTableView.clear_tooltip")); // $NON-NLS-1$ //$NON-NLS-2$
   builder.setCommand(
       new ICommandExecutor() {
         @Override
         public void execute(final IExecutionContext executionContext) throws Exception {
           beanTableModel.clear();
         }
       });
   return builder.build();
 }
  private static List<IAttribute<Object>> createInstance() {
    final IBeanAttributesBuilder builder = Attributes.builder(RadioStation.class);

    // frequency
    IBeanAttributeBluePrint<Object> bp =
        builder.add(RadioStation.FREQUENCY_PROPERTY).setLabel("Frequency");
    bp.setTableColumnWidth(180);
    bp.setControlPanel().setControlCreator(new HzValueControlCreator());

    // band
    bp = builder.add(RadioStation.BAND_PROPERTY).setLabel("Band");
    bp.setTableColumnWidth(100);
    bp.setDefaultValue(Band.UKW);

    // modulation
    bp = builder.add(RadioStation.MODULATION_PROPERTY).setLabel("Modulation");
    bp.setTableColumnWidth(100);
    bp.setDefaultValue(Modulation.FM);

    // bandwidth
    bp = builder.add(RadioStation.BANDWIDTH_PROPERTY).setLabel("Bandwidth");
    bp.setControlPanel().setControlCreator(new HzValueControlCreator());
    bp.setTableColumnWidth(100);
    bp.setDefaultValue(new HzValue(250, HertzUnitSet.KH));

    // distance
    bp = builder.add(RadioStation.DISTANCE_PROPERTY).setLabel("Distance");
    final IConverterProvider converters = Toolkit.getConverterProvider();
    final IObjectStringConverter<Long> converter;
    converter =
        converters.unitValueConverter(
            new LongDoubleUnitConverter(MillimeterUnitSet.KILO_METER), Double.class);
    bp.setControlPanel()
        .setControlCreator(new DistanceValueControlCreator())
        .setObjectLabelConverter(converter);
    bp.setTableColumnWidth(100);

    // category
    bp = builder.add(RadioStation.CATEGORY_PROPERTY).setLabel("Category");
    bp.setTableColumnWidth(100);
    bp.setDefaultValue(Category.OTHER);

    // name
    bp = builder.add(RadioStation.NAME_PROPERTY).setLabel("Name");
    bp.setTableColumnWidth(180);

    return builder.build();
  };
 public AbstractUiResultCallback() {
   this.uiThreadAccess = Toolkit.getUiThreadAccess();
 }