private void disposeNatTableComp() {
   if (contextsSelectComp != null && !contextsSelectComp.isDisposed()) {
     contextsSelectComp.dispose();
   }
   if (contextTableComp != null && !contextTableComp.isDisposed()) {
     contextTableComp.dispose();
   }
   if (buttonsComp != null && !buttonsComp.isDisposed()) {
     buttonsComp.dispose();
   }
 }
 @After
 public void tearDown() throws Exception {
   composite.dispose();
   if (createdDisplay) {
     display.dispose();
   }
 }
Exemple #3
0
  /** 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);
  }
Exemple #4
0
  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);
  }
Exemple #5
0
  /*
   * (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();
  }
Exemple #6
0
 public void dispose() {
   super.dispose();
   List<XulComponent> pops = xulDomContainer.getDocumentRoot().getElementsByTagName("menupopup");
   for (XulComponent pop : pops) {
     ((MenuManager) pop.getManagedObject()).dispose();
   }
 }
Exemple #7
0
 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();
 }
Exemple #9
0
 /** @see org.eclipse.swt.widgets.Widget#dispose() */
 @Override
 public void dispose() {
   listComposite.dispose();
   if (displayTitle) {
     title.dispose();
   }
   super.dispose();
 }
  /** {@inheritDoc} */
  @Override
  public void dispose() {
    if (null != thumbnail) {
      thumbnail.deactivate();
      thumbnail = null;
    }

    super.dispose();
  }
 public void dispose() {
   IWorkbench workbench = PlatformUI.getWorkbench();
   IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
   workbenchWindow.removePerspectiveListener(perspectiveAdapter);
   Composite parent = getParent();
   if (parent != null && !parent.isDisposed()) {
     parent.dispose();
   }
 }
Exemple #12
0
 public void dispose() {
   if (!isDisposed()) {
     if (control instanceof Composite) {
       ((Composite) control).dispose();
     }
     item.dispose();
     tabset.remove(this);
   }
 }
Exemple #13
0
 @Override
 public void dispose() {
   blue.dispose();
   darkPurple.dispose();
   lightBlue.dispose();
   purple.dispose();
   red.dispose();
   super.dispose();
 }
 @Override
 public void dispose() {
   callbacks.clear();
   for (org.eclipse.swt.graphics.Color c : colorRegistry) {
     c.dispose();
   }
   colorRegistry.clear();
   super.dispose();
 }
 /**
  * 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();
     }
   }
 }
Exemple #16
0
  public void dispose() {
    /*
     * Unregister listeners.
     */
    for (IAttributeEditor editor : this.editors.values()) {
      editor.removeAttributeListener(forwardListener);
    }

    super.dispose();
  }
  @Override
  public void dispose() {
    if (mainComposite != null) {
      mainComposite.dispose();
      mainComposite = null;

      optimalizationLevel.dispose();
      otherFlags.dispose();
    }
  }
Exemple #18
0
 void reset() {
   if (rootComposite != null) {
     rootComposite.dispose();
   }
   rootComposite = new Composite(this, SWT.NULL);
   rootComposite.setBackground(getBackground());
   rootComposite.setLayout(new GridLayout());
   addSeverityCells(getParent().getBackground());
   layout();
 }
 public void dispose() {
   if (roiListener != null) {
     try {
       roiViewer.removeROIListener(roiListener);
     } catch (Exception ne) {
       logger.error("Cannot remove roi listener", ne);
     }
   }
   super.dispose();
 }
 /** 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();
   }
 }
 @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();
 }
  @Override
  public void dispose() {
    if (mainComposite != null) {
      mainComposite.dispose();
      mainComposite = null;

      objects.dispose();
      libraries.dispose();
      librarySearchPath.dispose();
      disablePredefinedExtrnalDirs.dispose();
    }
  }
  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();
  }
  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);
  }
  /** 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);
    }
  }
Exemple #26
0
 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);
   }
 }
 /** 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));
 }
 /** 关闭模型 */
 @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();
   }
 }
  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();
      }
    }
  }
    /** @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();
    }