コード例 #1
0
 private void disposeNatTableComp() {
   if (contextsSelectComp != null && !contextsSelectComp.isDisposed()) {
     contextsSelectComp.dispose();
   }
   if (contextTableComp != null && !contextTableComp.isDisposed()) {
     contextTableComp.dispose();
   }
   if (buttonsComp != null && !buttonsComp.isDisposed()) {
     buttonsComp.dispose();
   }
 }
コード例 #2
0
 @After
 public void tearDown() throws Exception {
   composite.dispose();
   if (createdDisplay) {
     display.dispose();
   }
 }
コード例 #3
0
ファイル: View.java プロジェクト: willuhn/jameica
  /** Leert die Anzeige. Wird beim Wechsel von einem Dialog auf den naechsten aufgerufen. */
  protected void cleanContent() {
    if (content != null && !content.isDisposed()) content.dispose();

    if (scroll != null && !scroll.isDisposed()) scroll.dispose();

    if (Customizing.SETTINGS.getBoolean("application.scrollview", false)) {
      scroll = new ScrolledComposite(view, SWT.V_SCROLL | SWT.H_SCROLL);
      scroll.setLayoutData(new GridData(GridData.FILL_BOTH));
      scroll.setLayout(SWTUtil.createGrid(1, true));
      scroll.setExpandHorizontal(true);
      scroll.setExpandVertical(true);
      scroll.setMinHeight(Customizing.SETTINGS.getInt("application.scrollview.minheight", 580));

      content = new Composite(scroll, SWT.NONE);
      scroll.setContent(content);
    } else {
      content = new Composite(view, SWT.NONE);
    }

    content.setLayoutData(new GridData(GridData.FILL_BOTH));
    GridLayout l = new GridLayout();
    l.marginHeight = 6;
    l.marginWidth = 6;
    content.setLayout(l);

    if (this.titlePart != null) {
      this.titlePart.clearButtons();
      this.titlePart.addButton(new PanelButtonBack()); // Zurueckbutton ist immer dabei
    }

    if (notifications != null) notifications.reset();

    setTitle(null);
  }
コード例 #4
0
ファイル: Java3DViewer.java プロジェクト: alexeyivanov/FEM
  public static void view(DrawModel d) {
    final Display display = new Display();
    final Shell shell = new Shell(display);
    shell.setLayout(new FillLayout());

    Composite composite = new Composite(shell, SWT.EMBEDDED | SWT.NO_BACKGROUND);
    Frame baseFrame = SWT_AWT.new_Frame(composite);

    baseFrame.setBounds(0, 0, 800, 600);

    Java3DViewer viewer = new Java3DViewer(baseFrame, d);
    baseFrame.add(viewer);

    shell.open();

    d.setFaceColor(Color.GREEN);
    d.circle(0.9);
    //		viewer.draw(d);

    while (!shell.isDisposed()) {
      if (!display.readAndDispatch()) display.sleep();
    }

    baseFrame.dispose();
    shell.dispose();
    composite.dispose();
    display.dispose();
    System.exit(0);
  }
コード例 #5
0
ファイル: SkinComposite.java プロジェクト: paulcager/andmore
  /*
   * (non-Javadoc)
   *
   * @see org.eclipse.swt.widgets.Widget#dispose()
   */
  @Override
  public void dispose() {
    if (androidInput != null) {
      androidInput.dispose();
    }

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

    Layout layout = getLayout();
    if (layout instanceof AndroidSkinLayout) {
      ((AndroidSkinLayout) layout).dispose();
    }

    skin = null;
    currentKey = null;
    keyListener = null;
    mainDisplayMouseListener = null;
    mainDisplayMouseMoveListener = null;

    if (!Platform.getOS().equals(Platform.OS_MACOSX)) {
      long hnd = androidInstance.getWindowHandle();
      if (hnd > 0) {
        NativeUIUtils.showWindow(hnd);
        NativeUIUtils.restoreWindow(hnd);
      }

      // Force update on redrawing
      androidInstance.setWindowHandle(0);
    }

    super.dispose();
  }
コード例 #6
0
ファイル: AbstractGraph.java プロジェクト: MarsChan/learngit
 public void dispose() {
   super.dispose();
   List<XulComponent> pops = xulDomContainer.getDocumentRoot().getElementsByTagName("menupopup");
   for (XulComponent pop : pops) {
     ((MenuManager) pop.getManagedObject()).dispose();
   }
 }
コード例 #7
0
ファイル: EditComposite.java プロジェクト: rols/drc
 private List<Text> addTextFrom(final Page page, final Composite c) {
   if (lines != null) {
     for (Composite line : lines) {
       line.dispose();
     }
   }
   List<Text> list = new ArrayList<Text>();
   this.page = page;
   Composite lineComposite = new Composite(c, SWT.NONE);
   setLineLayout(lineComposite);
   if (lines != null) lines.add(lineComposite);
   for (Word word : JavaConversions.asJavaIterable(page.words())) {
     if (word.original().equals(Page.ParagraphMarker())) {
       lineComposite = new Composite(c, SWT.NONE);
       setLineLayout(lineComposite);
       lines.add(lineComposite);
     } else {
       Text text = new Text(lineComposite, SWT.NONE);
       setCssName(text);
       text.setText(TextHelper.fixForDisplay(word.history().top().form()));
       handleEmptyText(text);
       // option: word.isPossibleError() ? UNCHECKED : DEFAULT
       text.setForeground(parent.getDisplay().getSystemColor(DEFAULT));
       text.setData(Word.class.toString(), word);
       text.setData(Page.class.toString(), page);
       addListeners(text);
       text.setEditable(!word.isLocked() && !page.done());
       list.add(text);
     }
   }
   this.layout();
   return list;
 }
 @Override
 public void dispose() {
   property.removePropertyChangeListener(this);
   if (eventAdmin != null) {
     eventAdmin.deleteIObserver(this);
   }
   super.dispose();
 }
コード例 #9
0
 /** @see org.eclipse.swt.widgets.Widget#dispose() */
 @Override
 public void dispose() {
   listComposite.dispose();
   if (displayTitle) {
     title.dispose();
   }
   super.dispose();
 }
コード例 #10
0
  /** {@inheritDoc} */
  @Override
  public void dispose() {
    if (null != thumbnail) {
      thumbnail.deactivate();
      thumbnail = null;
    }

    super.dispose();
  }
コード例 #11
0
 public void dispose() {
   IWorkbench workbench = PlatformUI.getWorkbench();
   IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
   workbenchWindow.removePerspectiveListener(perspectiveAdapter);
   Composite parent = getParent();
   if (parent != null && !parent.isDisposed()) {
     parent.dispose();
   }
 }
コード例 #12
0
ファイル: TabItem.java プロジェクト: kolinus/pentaho-kettle
 public void dispose() {
   if (!isDisposed()) {
     if (control instanceof Composite) {
       ((Composite) control).dispose();
     }
     item.dispose();
     tabset.remove(this);
   }
 }
コード例 #13
0
ファイル: ECContentReal.java プロジェクト: vrsarmento/yak
 @Override
 public void dispose() {
   blue.dispose();
   darkPurple.dispose();
   lightBlue.dispose();
   purple.dispose();
   red.dispose();
   super.dispose();
 }
コード例 #14
0
 @Override
 public void dispose() {
   callbacks.clear();
   for (org.eclipse.swt.graphics.Color c : colorRegistry) {
     c.dispose();
   }
   colorRegistry.clear();
   super.dispose();
 }
コード例 #15
0
 /**
  * Disposes the TabContents objects passed to this method. If the 'currentTab' is going to be
  * disposed, then the caller should call aboutToBeHidden() on the currentTab and set it to null
  * before calling this method. Also, the caller needs to ensure that descriptorToTab map entries
  * corresponding to the disposed TabContents objects are also removed.
  *
  * @param tabs
  * @since 3.6
  */
 protected void disposeTabs(final Collection tabs) {
   for (final Iterator iter = tabs.iterator(); iter.hasNext(); ) {
     final TabContents tab = (TabContents) iter.next();
     final Composite composite = (Composite) tabToComposite.remove(tab);
     tab.dispose();
     if (composite != null) {
       composite.dispose();
     }
   }
 }
コード例 #16
0
ファイル: AttributeList.java プロジェクト: ashish0038/rahasia
  public void dispose() {
    /*
     * Unregister listeners.
     */
    for (IAttributeEditor editor : this.editors.values()) {
      editor.removeAttributeListener(forwardListener);
    }

    super.dispose();
  }
コード例 #17
0
  @Override
  public void dispose() {
    if (mainComposite != null) {
      mainComposite.dispose();
      mainComposite = null;

      optimalizationLevel.dispose();
      otherFlags.dispose();
    }
  }
コード例 #18
0
ファイル: AlertPane.java プロジェクト: troiska/Vega
 void reset() {
   if (rootComposite != null) {
     rootComposite.dispose();
   }
   rootComposite = new Composite(this, SWT.NULL);
   rootComposite.setBackground(getBackground());
   rootComposite.setLayout(new GridLayout());
   addSeverityCells(getParent().getBackground());
   layout();
 }
コード例 #19
0
 public void dispose() {
   if (roiListener != null) {
     try {
       roiViewer.removeROIListener(roiListener);
     } catch (Exception ne) {
       logger.error("Cannot remove roi listener", ne);
     }
   }
   super.dispose();
 }
コード例 #20
0
 /** Recreate the receiver given the new side */
 private void recreate() {
   if (region != null && !region.isDisposed()) {
     Composite parent = region.getParent();
     boolean animating = animationItem.animationRunning();
     AnimationManager.getInstance().removeItem(animationItem);
     region.dispose();
     createContents(parent, workbenchWindow);
     if (animating) animationItem.animationStart();
   }
 }
コード例 #21
0
 @Override
 public void dispose() {
   if (this.currentEntity != null) {
     this.currentEntity.close(top, this);
     this.currentEntity = null;
   }
   if (top != null && !top.isDisposed()) {
     top.dispose();
   }
   super.dispose();
 }
コード例 #22
0
  @Override
  public void dispose() {
    if (mainComposite != null) {
      mainComposite.dispose();
      mainComposite = null;

      objects.dispose();
      libraries.dispose();
      librarySearchPath.dispose();
      disablePredefinedExtrnalDirs.dispose();
    }
  }
コード例 #23
0
  public void dispose() {
    IThemeManager themeManager = PlatformUI.getWorkbench().getThemeManager();
    themeManager.removePropertyChangeListener(themeChangeListener);
    ITheme theme = themeManager.getCurrentTheme();
    theme.removePropertyChangeListener(themeChangeListener);

    if (content != null) content.dispose();

    up.dispose();
    down.dispose();
    equal.dispose();
  }
コード例 #24
0
  private void recreateRootComposite() {
    if (rootComposite != null) rootComposite.dispose();
    rootComposite = new Composite(parentComposite, SWT.NONE);
    rootComposite.setLayout(new FillLayout());

    final FormData fd = new FormData();
    fd.left = new FormAttachment(0);
    fd.right = new FormAttachment(100);
    fd.top = new FormAttachment(toolbarComposite);
    fd.bottom = new FormAttachment(100);
    rootComposite.setLayoutData(fd);
  }
コード例 #25
0
  /** Shows/hides the advanced option widgets. */
  protected void handleAdvancedButtonSelect() {
    Composite composite = (Composite) getControl();

    if (advancedComposite != null) {
      advancedComposite.dispose();
      advancedComposite = null;
      advancedButton.setText(Messages.Dialog_Advanced_Button_Closed);
    } else {
      createAdvancedComposite(composite);
      advancedButton.setText(Messages.Dialog_Advanced_Button_Opened);
    }
  }
コード例 #26
0
ファイル: CommitEditorPage.java プロジェクト: stefanlay/egit
 private void fillTags(Composite parent, FormToolkit toolkit) {
   if (tagLabelArea != null) tagLabelArea.dispose();
   tagLabelArea = toolkit.createComposite(parent);
   GridLayoutFactory.fillDefaults().spacing(1, 1).numColumns(4).applyTo(tagLabelArea);
   GridDataFactory.fillDefaults().grab(true, true).applyTo(tagLabelArea);
   List<String> tags = getTags();
   for (String tag : tags) {
     CLabel tagLabel = new CLabel(tagLabelArea, SWT.NONE);
     toolkit.adapt(tagLabel, false, false);
     tagLabel.setImage(getImage(UIIcons.TAG));
     tagLabel.setText(tag);
   }
 }
コード例 #27
0
 /** Clears the look of the forms body. */
 protected void clearFormBody() {
   if (messageComposite != null && !messageComposite.isDisposed()) {
     messageComposite.dispose();
   }
   for (TableColumn tableColumn : tableViewer.getTable().getColumns()) {
     tableColumn.dispose();
   }
   tableViewer.setInput(Collections.emptyList());
   tableViewer.getTable().setHeaderVisible(false);
   tableViewer.getTable().setLinesVisible(false);
   tableViewer.getTable().setVisible(false);
   tableViewer.getTable().setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false));
 }
コード例 #28
0
 /** 关闭模型 */
 @Override
 public void close(Composite top, EntityViewPart view) {
   if (!top.isDisposed()) {
     BindingHandler handler = null;
     String viewID = view.getSite().getId();
     // 用户视图
     if (viewID.equals(ProductDeployView.ID)) {
       handler = (ProductDeployViewerBindingHandler) viewerHandlers.get(viewID);
     }
     handler.detachListeners();
     handler.destroy();
     top.dispose();
   }
 }
コード例 #29
0
  private void disposeComposite() {
    if (summaryComp != null && !summaryComp.isDisposed()) {
      summaryComp.dispose();
    }

    if (resultComp != null && !resultComp.isDisposed()) {
      resultComp.dispose();
    }
    if (chartComposite != null && !chartComposite.isDisposed()) {
      for (Control control : chartComposite.getChildren()) {
        control.dispose();
      }
    }
  }
コード例 #30
0
    /** @see Widget#dispose() */
    @Override
    public void dispose() {
      SchemaService ss = PlatformUI.getWorkbench().getService(SchemaService.class);
      InstanceService is = PlatformUI.getWorkbench().getService(InstanceService.class);

      ss.removeSchemaServiceListener(schemaListener);
      is.removeListener(instanceListener);

      refreshImage.dispose();

      listeners.clear();

      super.dispose();
    }