org.eclipse.swt.widgets.Button.addDisposeListener()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(175)

本文整理了Java中org.eclipse.swt.widgets.Button.addDisposeListener()方法的一些代码示例,展示了Button.addDisposeListener()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Button.addDisposeListener()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Button
类名称:Button
方法名:addDisposeListener

Button.addDisposeListener介绍

暂无

代码示例

代码示例来源:origin: org.eclipse/org.eclipse.search

public FileTypeEditor(IEditorRegistry registry, Combo textField, Button browseButton) {
  fTextField= textField;
  fBrowseButton= browseButton;
  
  fTextField.addDisposeListener(this);
  fBrowseButton.addDisposeListener(this);
  fBrowseButton.addSelectionListener(this);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.search

public FileTypeEditor(Combo textField, Button browseButton) {
  fTextField= textField;
  fBrowseButton= browseButton;
  fTextField.addDisposeListener(this);
  fBrowseButton.addDisposeListener(this);
  fBrowseButton.addSelectionListener(this);
}

代码示例来源:origin: BiglySoftware/BiglyBT

@Override
  public void imageDownloaded(Image image, String key, boolean returnedImmediately){
                   
    if ( image != null && returnedImmediately ){
       
      button.setImage(image);
            button.addDisposeListener(
       new DisposeListener(){
         
         @Override
         public void widgetDisposed(DisposeEvent e){
           ImageLoader.getInstance().releaseImage( key );
         }
       });
     
    }
  }
});

代码示例来源:origin: BiglySoftware/BiglyBT

public Image setButtonImage(Button btn, final String key) {
  Image bg = getImage(key);
  btn.setImage(bg);
  btn.addDisposeListener(new DisposeListener() {
    @Override
    public void widgetDisposed(DisposeEvent e) {
      releaseImage(key);
    }
  });
  return( bg );
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface

/**
 * Returns the change button for this field editor.
 *
 * @param parent
 *            The Composite to create the receiver in.
 *
 * @return the change button
 */
protected Button getChangeControl(Composite parent) {
  if (checkBox == null) {
    checkBox = new Button(parent, SWT.CHECK | SWT.LEFT);
    checkBox.setFont(parent.getFont());
    checkBox.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        boolean isSelected = checkBox.getSelection();
        valueChanged(wasSelected, isSelected);
        wasSelected = isSelected;
      }
    });
    checkBox.addDisposeListener(event -> checkBox = null);
  } else {
    checkParent(checkBox, parent);
  }
  return checkBox;
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface

/**
 * Returns the change button for this field editor.
 *
 * @param parent
 *            The Composite to create the receiver in.
 * 
 * @return the change button
 */
protected Button getChangeControl(Composite parent) {
  if (checkBox == null) {
    checkBox = new Button(parent, SWT.CHECK | SWT.LEFT);
    checkBox.setFont(parent.getFont());
    checkBox.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        boolean isSelected = checkBox.getSelection();
        valueChanged(wasSelected, isSelected);
        wasSelected = isSelected;
      }
    });
    checkBox.addDisposeListener(new DisposeListener() {
      public void widgetDisposed(DisposeEvent event) {
        checkBox = null;
      }
    });
  } else {
    checkParent(checkBox, parent);
  }
  return checkBox;
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface

/**
 * Get the change control. Create it in parent if required.
 * @param parent
 * @return Button
 */
protected Button getChangeControl(Composite parent) {
  if (changeButton == null) {
    changeButton = new Button(parent, SWT.PUSH);
    if (changeButtonText == null) {
      changeButtonText = JFaceResources.getString("openChange"); //$NON-NLS-1$
    }
    changeButton.setText(changeButtonText);
    changeButton.setFont(parent.getFont());
    changeButton.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent evt) {
        String newValue = changePressed();
        if (newValue != null) {
          setStringValue(newValue);
        }
      }
    });
    changeButton.addDisposeListener(event -> changeButton = null);
  } else {
    checkParent(changeButton, parent);
  }
  return changeButton;
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface

changeButton.addDisposeListener(new DisposeListener() {
  public void widgetDisposed(DisposeEvent event) {
    changeButton = null;

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface

/**
 * Returns the change button for this field editor.
 *
 * @param parent
 *            The Composite to create the receiver in.
 *
 * @return the change button
 */
protected Button getChangeControl(Composite parent) {
  if (checkBox == null) {
    checkBox = new Button(parent, SWT.CHECK | SWT.LEFT);
    checkBox.setFont(parent.getFont());
    checkBox.addSelectionListener(widgetSelectedAdapter(e -> {
      boolean isSelected = checkBox.getSelection();
      valueChanged(wasSelected, isSelected);
      wasSelected = isSelected;
    }));
    checkBox.addDisposeListener(event -> checkBox = null);
  } else {
    checkParent(checkBox, parent);
  }
  return checkBox;
}

代码示例来源:origin: org.eclipse/org.eclipse.jst.j2ee.ui

setAdvancedLabelText();
final Cursor hand = new Cursor(advancedButton.getDisplay(), SWT.CURSOR_HAND);
advancedButton.addDisposeListener(new DisposeListener() {
  public void widgetDisposed(DisposeEvent e) {
    hand.dispose();

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface

changeFontButton.addDisposeListener(new DisposeListener() {
  public void widgetDisposed(DisposeEvent event) {
    changeFontButton = null;

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface

changeFontButton.addDisposeListener(event -> changeFontButton = null);
changeFontButton.setFont(parent.getFont());
setButtonLayoutData(changeFontButton);

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface

fButton.addDisposeListener(new DisposeListener() {
  public void widgetDisposed(DisposeEvent event) {

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface

/**
 * Get the change control. Create it in parent if required.
 * @param parent
 * @return Button
 */
protected Button getChangeControl(Composite parent) {
  if (changeButton == null) {
    changeButton = new Button(parent, SWT.PUSH);
    if (changeButtonText == null) {
      changeButtonText = JFaceResources.getString("openChange"); //$NON-NLS-1$
    }
    changeButton.setText(changeButtonText);
    changeButton.setFont(parent.getFont());
    changeButton.addSelectionListener(widgetSelectedAdapter(evt -> {
      String newValue = changePressed();
      if (newValue != null) {
        setStringValue(newValue);
      }
    }));
    changeButton.addDisposeListener(event -> changeButton = null);
  } else {
    checkParent(changeButton, parent);
  }
  return changeButton;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples

redButton.addSelectionListener(colorListener);
yellowButton.addSelectionListener(colorListener);
yellowButton.addDisposeListener(e -> {
  boldImage.dispose();
  italicImage.dispose();

代码示例来源:origin: BiglySoftware/BiglyBT

button.setImage(image);
button.addDisposeListener(
    new DisposeListener(){

代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench

private void createShowLogButton(Composite parent){
    IViewDescriptor descriptor = PlatformUI.getWorkbench().getViewRegistry().find(LOG_VIEW_ID);
    if (descriptor == null) {
      return;
    }
    Button button = new Button(parent, SWT.PUSH);
    button.addSelectionListener(widgetSelectedAdapter(e -> {
      try {
        PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(LOG_VIEW_ID);
      } catch (CoreException ce) {
        StatusManager.getManager().handle(ce, WorkbenchPlugin.PI_WORKBENCH);
      }
    }));
    final Image image = descriptor.getImageDescriptor().createImage();
    button.setImage(image);
    button.setToolTipText(WorkbenchMessages.ErrorLogUtil_ShowErrorLogTooltip);
    button.addDisposeListener(e -> image.dispose());
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface

changeFontButton.addDisposeListener(event -> changeFontButton = null);
changeFontButton.setFont(parent.getFont());
setButtonLayoutData(changeFontButton);

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface

fButton.addDisposeListener(event -> {
  if (fImage != null) {
    fImage.dispose();

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface

fButton.setImage(fImage);
fButton.addSelectionListener(widgetSelectedAdapter(event -> open()));
fButton.addDisposeListener(event -> {
  if (fImage != null) {
    fImage.dispose();

相关文章

Button类方法