Exemplo n.º 1
0
 public static void dispose(Widget widget) {
   if (widget != null && !widget.isDisposed()) {
     try {
       widget.dispose();
     } catch (Exception e) {
       log.debug("widget dispose error", e);
     }
   }
 }
Exemplo n.º 2
0
 void releaseParent_pp() {
   super.releaseParent_pp();
   if (cascade != null) cascade.setMenu(null);
   if ((style & SWT.BAR) != 0 && this == parent.menuBar) {
     parent.setMenuBar(null);
   }
 }
Exemplo n.º 3
0
 void releaseHandle() {
   if (handle != 0) OS.GCHandle_Free(handle);
   handle = 0;
   if (imageHandle != 0) OS.GCHandle_Free(imageHandle);
   imageHandle = 0;
   super.releaseHandle();
 }
Exemplo n.º 4
0
 void releaseWidget() {
   super.releaseWidget();
   parent = null;
   text = null;
   styles = null;
   ranges = null;
 }
Exemplo n.º 5
0
 void releaseChildren_pp(boolean destroy) {
   MenuItem[] items = getItems();
   for (int i = 0; i < items.length; i++) {
     MenuItem item = items[i];
     if (item != null && !item.isDisposed()) {
       item.release(false);
     }
   }
   super.releaseChildren_pp(destroy);
 }
Exemplo n.º 6
0
 void hookEvents_pp() {
   super.hookEvents_pp();
   if ((style & SWT.BAR) == 0) {
     int aboutToHideProxy = OS.SignalHandler_new(handle, OS.QSIGNAL_ABOUTTOHIDE);
     OS.QObject_connectOrThrow(
         handle, "aboutToHide()", aboutToHideProxy, "widgetSignal()", OS.QT_AUTOCONNECTION);
     int aboutToShowProxy = OS.SignalHandler_new(handle, OS.QSIGNAL_ABOUTTOSHOW);
     OS.QObject_connectOrThrow(
         handle, "aboutToShow()", aboutToShowProxy, "widgetSignal()", OS.QT_AUTOCONNECTION);
   }
 }
Exemplo n.º 7
0
 void releaseWidget() {
   super.releaseWidget();
   parent = null;
   rectangles = proportions = null;
   bounds = null;
 }
Exemplo n.º 8
0
  public void renderInitialization(final Widget widget) throws IOException {
    IWidgetSynchronizer synchronizer = WidgetSynchronizerFactory.getSynchronizerForWidget(widget);
    List styleList = new ArrayList();
    int style = widget.getStyle();
    if ((style & SWT.BORDER) != 0) {
      styleList.add("BORDER");
    }
    if ((style & MODAL) != 0) {
      styleList.add("MODAL");
    }
    if ((style & SWT.ON_TOP) != 0) {
      styleList.add("ON_TOP");
    }
    if ((style & SWT.TITLE) != 0) {
      styleList.add("TITLE");
    }
    if ((style & SWT.TOOL) != 0) {
      styleList.add("TOOL");
    }
    if ((style & SWT.SHEET) != 0) {
      styleList.add("SHEET");
    }
    if ((style & SWT.MIN) != 0) {
      styleList.add("MIN");
    }
    if ((style & SWT.MAX) != 0) {
      styleList.add("MAX");
    }
    if ((style & SWT.CLOSE) != 0) {
      styleList.add("CLOSE");
    }
    if ((style & SWT.RESIZE) != 0) {
      styleList.add("RESIZE");
    }
    String[] styles = new String[styleList.size()];
    styleList.toArray(styles);
    Composite parent = ((Shell) widget).getParent();
    if (parent instanceof Shell) {
      String parentId = WidgetUtil.getId(parent);
      synchronizer.newWidget(styles, new Object[] {parentId});
    }
    synchronizer.newWidget(styles);

    // old
    //    JSWriter writer = JSWriter.getWriterFor( widget );
    //    Shell shell = ( Shell )widget;
    //    writer.newWidget( QX_TYPE );
    //    ControlLCAUtil.writeStyleFlags( shell );
    //    if( ( style & MODAL ) != 0 ) {
    //      writer.call( "addState", new Object[] { "rwt_APPLICATION_MODAL" } );
    //    }
    //    if( ( style & SWT.ON_TOP ) != 0 ) {
    //      writer.call( "addState", new Object[] { "rwt_ON_TOP" } );
    //    }
    //    if( ( style & SWT.TITLE ) != 0 ) {
    //      writer.call( "addState", new Object[]{ "rwt_TITLE" } );
    //    }
    //    if( ( style & SWT.TOOL ) != 0 ) {
    //      writer.call( "addState", new Object[]{ "rwt_TOOL" } );
    //    }
    //    if( ( style & SWT.SHEET ) != 0 ) {
    //      writer.call( "addState", new Object[]{ "rwt_SHEET" } );
    //    }
    //    writer.set( "showMinimize", ( style & SWT.MIN ) != 0 );
    //    writer.set( "allowMinimize", ( style & SWT.MIN ) != 0 );
    //    writer.set( "showMaximize", ( style & SWT.MAX ) != 0 );
    //    writer.set( "allowMaximize", ( style & SWT.MAX ) != 0 );
    //    writer.set( "showClose", ( style & SWT.CLOSE ) != 0 );
    //    writer.set( "allowClose", ( style & SWT.CLOSE ) != 0 );
    //    Boolean resizable = Boolean.valueOf( ( style & SWT.RESIZE ) != 0 );
    //    writer.set( "resizable",
    //                new Object[] { resizable, resizable, resizable, resizable } );
    //    if( parent instanceof Shell ) {
    //      writer.set( "parentShell", parent );
    //    }
    //    writer.call( "initialize", null );
  }
Exemplo n.º 9
0
 void releaseWidget_pp() {
   super.releaseWidget_pp();
   if (parent != null) parent.removeMenu(this);
   parent = null;
   cascade = null;
 }
Exemplo n.º 10
0
 void createWidget(int index) {
   checkOrientation(parent);
   super.createWidget(index);
   parent.addMenu(this);
 }
Exemplo n.º 11
0
 void releaseWidget() {
   super.releaseWidget();
   parent = null;
   image = null;
   font = null;
 }
Exemplo n.º 12
0
 void releaseParent() {
   super.releaseParent();
   if (this == parent.getCaret()) parent.setCaret(null);
 }