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

x33g5p2x  于2022-01-18 转载在 其他  
字(7.2k)|赞(0)|评价(0)|浏览(177)

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

Canvas.addDisposeListener介绍

暂无

代码示例

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

/**
 * Creates a new composite ruler canvas.
 *
 * @param parent the parent composite
 * @param style the SWT styles
 */
public CompositeRulerCanvas(Composite parent, int style) {
  super(parent, style);
  fMenuDetectListener= new Listener() {
    @Override
    public void handleEvent(Event event) {
       if (event.type == SWT.MenuDetect) {
        Menu menu= getMenu();
        if (menu != null) {
          menu.setLocation(event.x, event.y);
          menu.setVisible(true);
        }
      }
    }
  };
  super.addDisposeListener(new DisposeListener() {
    @Override
    public void widgetDisposed(DisposeEvent e) {
      if (fCachedListeners != null) {
        fCachedListeners.clear();
        fCachedListeners= null;
      }
    }
  });
}

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

@Override
public void addDisposeListener(DisposeListener listener) {
  super.addDisposeListener(listener);
  addListener(DisposeListener.class, listener);
}

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

@Override
public void addDisposeListener(DisposeListener listener) {
  super.addDisposeListener(listener);
  addListener(DisposeListener.class, listener);
}

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

/**
 * Creates a new composite ruler canvas.
 *
 * @param parent the parent composite
 * @param style the SWT styles
 */
public CompositeRulerCanvas(Composite parent, int style) {
  super(parent, style);
  fMenuDetectListener= event -> {
    if (event.type == SWT.MenuDetect) {
      Menu menu= getMenu();
      if (menu != null) {
        menu.setLocation(event.x, event.y);
        menu.setVisible(true);
      }
    }
  };
  super.addDisposeListener(e -> {
    if (fCachedListeners != null) {
      fCachedListeners.clear();
      fCachedListeners= null;
    }
  });
}

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

imageLoader.releaseImage(sConfigID);
image = imageLoader.getImage(sConfigID + ".image");
drawable.addDisposeListener(new DisposeListener() {
  @Override
  public void widgetDisposed(DisposeEvent e) {
drawable.addDisposeListener(new DisposeListener() {
  @Override
  public void widgetDisposed(DisposeEvent e) {

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

fCanvas.addDisposeListener(new DisposeListener() {
  @Override
  public void widgetDisposed(DisposeEvent e) {

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

});
fCanvas.addDisposeListener(e -> {
  handleDispose();
  fTextViewer= null;

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

protected void adjustItemNumber() {
  if (fComposite == null)
    return;
  Control[] children= fComposite.getChildren();
  int oldSize= children.length;
  int newSize= fInput == null ? 0 : fInput.fAnnotations.length;
  Display display= fShell.getDisplay();
  // add missing items
  for (int i= oldSize; i < newSize; i++) {
    Canvas canvas= new Canvas(fComposite, SWT.NONE);
    Object gridData= fLayouter.getLayoutData();
    canvas.setLayoutData(gridData);
    canvas.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
    canvas.addPaintListener(fPaintListener);
    canvas.addMouseTrackListener(fMouseTrackListener);
    canvas.addMouseListener(fMouseListener);
    canvas.addListener(SWT.MenuDetect, fMenuDetectListener);
    canvas.addDisposeListener(fDisposeListener);
  }
  // dispose of exceeding resources
  for (int i= oldSize; i > newSize; i--) {
    Item item= (Item) children[i - 1].getData();
    item.deselect();
    children[i - 1].dispose();
  }
}

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

protected void adjustItemNumber() {
  if (fComposite == null)
    return;
  Control[] children= fComposite.getChildren();
  int oldSize= children.length;
  int newSize= fInput == null ? 0 : fInput.fAnnotations.length;
  Display display= fShell.getDisplay();
  // add missing items
  for (int i= oldSize; i < newSize; i++) {
    Canvas canvas= new Canvas(fComposite, SWT.NONE);
    Object gridData= fLayouter.getLayoutData();
    canvas.setLayoutData(gridData);
    canvas.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
    canvas.addPaintListener(fPaintListener);
    canvas.addMouseTrackListener(fMouseTrackListener);
    canvas.addMouseListener(fMouseListener);
    canvas.addListener(SWT.MenuDetect, fMenuDetectListener);
    canvas.addDisposeListener(fDisposeListener);
  }
  // dispose of exceeding resources
  for (int i= oldSize; i > newSize; i--) {
    Item item= (Item) children[i - 1].getData();
    item.deselect();
    children[i - 1].dispose();
  }
}

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

protected void adjustItemNumber() {
  if (fComposite == null)
    return;
  Control[] children= fComposite.getChildren();
  int oldSize= children.length;
  int newSize= fInput == null ? 0 : fInput.fAnnotations.length;
  Display display= fShell.getDisplay();
  // add missing items
  for (int i= oldSize; i < newSize; i++) {
    Canvas canvas= new Canvas(fComposite, SWT.NONE);
    Object gridData= fLayouter.getLayoutData();
    canvas.setLayoutData(gridData);
    canvas.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
    canvas.addPaintListener(fPaintListener);
    canvas.addMouseTrackListener(fMouseTrackListener);
    canvas.addMouseListener(fMouseListener);
    canvas.addListener(SWT.MenuDetect, fMenuDetectListener);
    canvas.addDisposeListener(fDisposeListener);
  }
  // dispose of exceeding resources
  for (int i= oldSize; i > newSize; i--) {
    Item item= (Item) children[i - 1].getData();
    item.deselect();
    children[i - 1].dispose();
  }
}

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

canvas.addDisposeListener(new DisposeListener() {
  @Override
  public void widgetDisposed(DisposeEvent e) {

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

fCanvas.addDisposeListener(new DisposeListener() {
  @Override
  public void widgetDisposed(DisposeEvent e) {

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

@Override
public Control createControl(CompositeRuler parentRuler, Composite parentControl) {
  fParentRuler= parentRuler;
  fCachedTextViewer= parentRuler.getTextViewer();
  fCachedTextWidget= fCachedTextViewer.getTextWidget();
  fCanvas= new Canvas(parentControl, SWT.NONE);
  fCanvas.setBackground(getBackground());
  fCanvas.addPaintListener(event -> {
    if (fCachedTextViewer != null)
      doubleBufferPaint(event.gc);
  });
  fCanvas.addDisposeListener(e -> {
    handleDispose();
    fCachedTextViewer= null;
    fCachedTextWidget= null;
  });
  fCanvas.addMouseListener(fMouseHandler);
  fCanvas.addMouseMoveListener(fMouseHandler);
  if (fCachedTextViewer != null) {
    fCachedTextViewer.addViewportListener(fInternalListener);
    fCachedTextViewer.addTextListener(fInternalListener);
  }
  fRevisionPainter.setParentRuler(parentRuler);
  fDiffPainter.setParentRuler(parentRuler);
  return fCanvas;
}

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

imageCanvas.addDisposeListener(e -> imageCanvasGC.dispose());

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

fCanvas.addDisposeListener(new DisposeListener() {
  @Override
  public void widgetDisposed(DisposeEvent event) {

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

fCanvas.addDisposeListener(new DisposeListener() {
  @Override
  public void widgetDisposed(DisposeEvent e) {

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

});
fCanvas.addDisposeListener(event -> {
  handleDispose();
  fTextViewer= null;

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

});
fCanvas.addDisposeListener(e -> {
  handleDispose();
  fCachedTextViewer= null;

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

fCanvas.addDisposeListener(new DisposeListener() {
  @Override
  public void widgetDisposed(DisposeEvent e) {

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

});
fCanvas.addDisposeListener(e -> {
  handleDispose();
  fCachedTextViewer= null;

相关文章

Canvas类方法