Exemplo n.º 1
0
 public void refresh() {
   if (elementWrapper != null) {
     nameText.removeModifyListener(this);
     nameText.setText(elementWrapper.getName());
     nameText.addModifyListener(this);
   }
 }
Exemplo n.º 2
0
 /** Sets the text without triggering a dialog-changed event. */
 public void setTextWithoutUpdate(String text) {
   fText = text;
   if (isOkToUse(fTextControl)) {
     fTextControl.removeModifyListener(fModifyListener);
     fTextControl.setText(text);
     fTextControl.addModifyListener(fModifyListener);
   }
 }
Exemplo n.º 3
0
  @Test
  public void testRemoveModifyListenerUnregistersUntypedEvents() {
    ModifyListener listener = mock(ModifyListener.class);
    text.addModifyListener(listener);

    text.removeModifyListener(listener);

    assertFalse(text.isListening(SWT.Modify));
  }
  private void removeListeners() {
    repositoryCombo.removePostSelectionChangedListener(repositoryListener);
    nameText.removeModifyListener(standardTextListener);
    descriptionText.removeModifyListener(standardTextListener);
    userText.removeModifyListener(standardTextListener);
    passwordText.removeModifyListener(standardTextListener);

    for (IRepositoryFactory f : dynamicControls.keySet()) {
      for (LabelText control : dynamicControls.get(f).values()) {
        control.removeModifyListener(standardTextListener);
      }
    }

    for (IRepositoryFactory f : dynamicChoices.keySet()) {
      for (LabelledCombo control : dynamicChoices.get(f).values()) {
        control.getCombo().removeModifyListener(standardTextListener);
      }
    }
  }
Exemplo n.º 5
0
  @Override
  public void dispose() {
    super.dispose();

    if (!dynamicEnabled) return;

    Text text = getText();
    if (!text.isDisposed()) {
      text.removeModifyListener(modifyListener);
    }
  }
  /** {@inheritDoc} */
  @Override
  public void refresh() {
    nameWidget.removeModifyListener(nameListener);

    final PictogramElement pe = getSelectedPictogramElement();
    if (pe != null) {
      final EObject bo =
          (EObject) Graphiti.getLinkService().getBusinessObjectForLinkedPictogramElement(pe);
      // the filter assured, that it is a node
      if (bo == null) return;
      bc = (node) bo;
      String value = "";
      value = bc.getName();
      nameWidget.setText(value == null ? "" : value);
      nameWidget.addModifyListener(nameListener);
    }
  }
 protected void removeListeners() {
   if (modifyListener != null) {
     portText.removeModifyListener(modifyListener);
   }
 }
Exemplo n.º 8
0
 /** @param listener */
 public void removeModifyListener(ModifyListener listener) {
   textControl.removeModifyListener(listener);
 }
 protected void removeListeners() {
   if (modifyListener != null) {
     nameText.removeModifyListener(modifyListener);
     uriText.removeModifyListener(modifyListener);
   }
 }
Exemplo n.º 10
0
 private void updateText() {
   text.removeModifyListener(mListener);
   text.setText(description.getDisplay() != null ? description.getDisplay() : "");
   text.addModifyListener(mListener);
 }