Example usage for org.eclipse.jface.databinding.swt SWTObservables getRealm

List of usage examples for org.eclipse.jface.databinding.swt SWTObservables getRealm

Introduction

In this page you can find the example usage for org.eclipse.jface.databinding.swt SWTObservables getRealm.

Prototype

@Deprecated
public static Realm getRealm(final Display display) 

Source Link

Document

Returns the realm representing the UI thread for the given display.

Usage

From source file:com.github.n_i_e.deepfolderview.SwtDuplicateMenu.java

License:Apache License

public static void main(String[] args) {
    final Display display = Display.getDefault();

    Realm.runWithDefault(SWTObservables.getRealm(display), new Runnable() {
        public void run() {
            try {
                final SwtDuplicateMenu window = new SwtDuplicateMenu();
                window.open();/*w w  w.  j a v a  2  s . c  om*/

                display.asyncExec(new Runnable() {
                    public void run() {
                        TableItem tableItem = new TableItem(window.table, SWT.NONE);
                        tableItem.setText(new String[] { "C:\\", "2015-01-01 00:00:00", "1", "2", "3" });

                        TableItem tableItem_1 = new TableItem(window.table, SWT.NONE);
                        tableItem_1.setText(new String[] { "D:\\", "2014-01-01 00:00:00", "100", "200", "1" });
                    }
                });
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    });
}

From source file:com.github.n_i_e.deepfolderview.SwtFileFolderMenu.java

License:Apache License

public static void main(String[] args) {
    final Display display = Display.getDefault();

    Realm.runWithDefault(SWTObservables.getRealm(display), new Runnable() {
        public void run() {
            try {
                final SwtFileFolderMenu window = new SwtFileFolderMenu();
                window.open();//  w ww  .j a v a  2 s .c  om
                /*
                               display.asyncExec(new Runnable() {
                                  public void run() {
                                     TableItem tableItem = new TableItem(window.table, SWT.NONE);
                                     tableItem.setText(new String[] {"C:\\", "2015-01-01 00:00:00", "1", "2", "3"});
                        
                                     TableItem tableItem_1 = new TableItem(window.table, SWT.NONE);
                                     tableItem_1.setText(new String[] {"D:\\", "2014-01-01 00:00:00", "100", "200", "1"});
                                  }
                               });*/
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    });
}

From source file:com.github.n_i_e.deepfolderview.SwtRootMenu.java

License:Apache License

public static void main(String[] args) {
    Display display = Display.getDefault();
    Realm.runWithDefault(SWTObservables.getRealm(display), new Runnable() {
        public void run() {
            try {
                SwtRootMenu window = new SwtRootMenu();
                window.open();//w ww.  ja  va2s . c om
                // test demonstration

            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    });
}

From source file:com.github.n_i_e.deepfolderview.SwtTaskTrayIcon.java

License:Apache License

public void swtEventLoop(final Display display) {
    Realm.runWithDefault(SWTObservables.getRealm(display), new Runnable() {
        public void run() {
            while (!icon.isDisposed()) {
                try {
                    if (!display.readAndDispatch()) {
                        display.sleep();
                    }/*from  w  w w .j  a  v a2 s. co  m*/
                } catch (SWTException e) {
                } catch (Exception e) {
                    writeError("Exception at SwtTaskTrayIcon bottom", e.toString());
                    e.printStackTrace();
                }
            }
            System.exit(0);
        }
    });

}

From source file:com.netxforge.screens.editing.base.util.DateChooserComboObservableValue.java

License:Open Source License

public DateChooserComboObservableValue(final DateChooserCombo combo, int updateEventType) {
    this(SWTObservables.getRealm(combo.getDisplay()), combo, updateEventType);
}

From source file:com.platzerworld.e4.biergarten.views.details.DetailsView.java

License:Open Source License

@Inject
public DetailsView(Composite parent) {
    final Composite composite = new Composite(parent, SWT.NONE);
    composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

    try {/*from   w  w  w. jav a2s . co m*/
        OleFrame frame = new OleFrame(parent, SWT.NONE);
        site = new OleClientSite(frame, SWT.NONE, "Excel.Sheet");
    } catch (SWTError e) {
        System.out.println("Unable to open activeX control");
        return;
    }

    try {
        OleFrame frame = new OleFrame(parent, SWT.NONE);
        site = new OleClientSite(frame, SWT.NONE, "Shell.Explorer.1");
        site.doVerb(OLE.OLEIVERB_INPLACEACTIVATE);
        OleAutomation auto = new OleAutomation(site);
        auto.invoke(Navigate, new Variant[] { new Variant("c:\\temp") });
    } catch (SWTError e) {
        System.out.println("Unable to open activeX control");
        return;
    }

    composite.setLayout(new GridLayout(2, false));
    Realm.runWithDefault(SWTObservables.getRealm(Display.getDefault()), new Runnable() {

        @Override
        public void run() {
            dbc = new DataBindingContext();
            contactValue = new WritableValue();
            firstNameText = createText(composite, "First Name:", "firstName");
            lastNameText = createText(composite, "Last Name:", "lastName");
            emailText = createText(composite, "Email:", "email");
        }
    });
}

From source file:com.rcpcompany.uibindings.internal.BindingContextImpl.java

License:Open Source License

/**
 * <!-- begin-user-doc -->Constructs and returns a new emptycontext.<!-- end-user-doc -->
 * //from   w w w.  j a  v  a 2s. c  om
 * @generated NOT
 */
public BindingContextImpl() {
    super();
    dbContext = new DataBindingContext(SWTObservables.getRealm(PlatformUI.getWorkbench().getDisplay()));

    // TODO Use the feature map
    eAdapters().add(myAdapter);

    final IManager manager = IManager.Factory.getManager();
    manager.getContexts().add(this);
    manager.eAdapters().add(myTextCommitStrategyAdapter);
    // Force recalcalation of the attribute
    getTextCommitStrategyCalculated();
}

From source file:com.rcpcompany.uibindings.internal.observables.AbstractSWTObservableValue.java

License:Open Source License

/**
 * Standard constructor for an SWT ObservableValue. Makes sure that the observable gets disposed
 * when the SWT widget is disposed.// w  w  w. java 2  s . c  om
 * 
 * @param widget
 */
protected AbstractSWTObservableValue(Widget widget) {
    this(SWTObservables.getRealm(widget.getDisplay()), widget);
}

From source file:com.rcpcompany.uibindings.internal.observables.AbstractSWTVetoableValue.java

License:Open Source License

/**
 * Standard constructor for an SWT VetoableValue. Makes sure that the observable gets disposed
 * when the SWT widget is disposed./*from   w ww .  j a v a2 s .  c  om*/
 * 
 * @param widget
 */
protected AbstractSWTVetoableValue(Widget widget) {
    this(SWTObservables.getRealm(widget.getDisplay()), widget);
}

From source file:com.rcpcompany.uibindings.internal.observables.CComboObservableList.java

License:Open Source License

/**
 * Constructs and returns a new obserable list for the specified combo.
 * //from ww  w .java 2  s  .  c  o m
 * @param ccombo the combo of the list
 */
public CComboObservableList(CCombo ccombo) {
    super(SWTObservables.getRealm(ccombo.getDisplay()));
    this.ccombo = ccombo;

    init();
}