Example #1
0
 public void notifyListeners(String eventName, JsonObject properties) {
   JsonValue value = properties.get("value");
   Event event = new Event();
   event.type = stringToTypeEvent(eventName);
   event.text = (value != null && value.isString() ? value.asString() : "");
   event.data = properties;
   listener.handleEvent(event);
 }
Example #2
0
 private void run() {
   Display.getCurrent().timerExec(-1, run);
   delayedListeners.remove(this);
   ((Control) event.widget).setBackground(bkg);
   listener.handleEvent(event);
   if (color != null) {
     color.dispose();
     color = null;
   }
 }
Example #3
0
 public void notifyChange() {
   IWizardPage[] pages = getPages();
   if (pages != null) {
     for (int i = 0; i < pages.length; i++) {
       IWizardPage iWizardPage = pages[i];
       iWizardPage.getWizard().getContainer().updateButtons();
       if (iWizardPage instanceof Listener) {
         ((Listener) iWizardPage).handleEvent(new Event());
       }
     }
   }
 }
  protected void handleAllSelectionChange(boolean state) {
    ArrayList arrayList = (ArrayList) tableViewer.getInput();
    if (!state) {
      selector.getSelectedModels().removeAll(arrayList);
    } else {
      selector.getSelectedModels().addAll(arrayList);
    }
    tableViewer.setAllChecked(state);

    // fire an event so the parent can update its controls
    if (listener != null) {
      Event changeEvent = new Event();
      changeEvent.type = SWT.Selection;
      changeEvent.widget = tableViewer.getTable();
      listener.handleEvent(changeEvent);
    }
    updateCountLabel();
  }
 /** @see org.eclipse.swt.events.KeyAdapter#keyReleased(org.eclipse.swt.events.KeyEvent) */
 public void keyReleased(KeyEvent e) {
   forward.handleEvent(null); // Das Event-Objekt interessiert uns eh nicht
 }
  protected void showContent(String type) {
    IExpressionProvider provider =
        ExpressionEditorService.getInstance().getExpressionProvider(type);

    Assert.isNotNull(provider);

    for (Control c : contentComposite.getChildren()) {
      c.dispose();
    }

    if (currentExpressionEditor != null) {
      currentExpressionEditor.dispose();
    }

    currentExpressionEditor = provider.getExpressionEditor(inputExpression, context);
    currentExpressionEditor.setIsPageFlowContext(isPageFlowContext);
    if (currentExpressionEditor != null) {
      currentExpressionEditor.createExpressionEditor(contentComposite, isPassword);
      contentComposite.layout(true, true);
      if (helpControl != null) {
        //				helpControl.setVisible(currentExpressionEditor.provideDialogTray());
        helpControl.setVisible(false);
        if (currentExpressionEditor.provideDialogTray()) {
          ToolItem item = ((ToolBar) helpControl).getItem(0);
          item.setSelection(true);
          openTrayListener.handleEvent(new Event());
        } else if (getTray() != null) {
          closeTray();
        }
      }
      if (dataBindingContext != null) {
        dataBindingContext.dispose();
      }
      dataBindingContext = new EMFDataBindingContext();

      UpdateValueStrategy selectionToExpressionType = new UpdateValueStrategy();
      IConverter convert =
          new Converter(IExpressionProvider.class, String.class) {

            @Override
            public Object convert(Object arg0) {
              return ((IExpressionProvider) arg0).getExpressionType();
            }
          };
      selectionToExpressionType.setConverter(convert);

      if (domain != null) {
        domain
            .getCommandStack()
            .execute(
                SetCommand.create(
                    domain, inputExpression, ExpressionPackage.Literals.EXPRESSION__TYPE, type));
      } else {
        inputExpression.setType(type);
      }
      currentExpressionEditor.bindExpression(
          dataBindingContext, context, inputExpression, viewerTypeFilters, expressionViewer);
      currentExpressionEditor.addListener(
          new Listener() {
            @Override
            public void handleEvent(Event event) {
              Button okButton = getButton(OK);
              if (okButton != null && !okButton.isDisposed()) {
                okButton.setEnabled(currentExpressionEditor.canFinish());
              }
            }
          });
      DialogSupport.create(this, dataBindingContext);
    }
  }