Example usage for org.eclipse.jface.dialogs TitleAreaDialog setTitleAreaColor

List of usage examples for org.eclipse.jface.dialogs TitleAreaDialog setTitleAreaColor

Introduction

In this page you can find the example usage for org.eclipse.jface.dialogs TitleAreaDialog setTitleAreaColor.

Prototype

public void setTitleAreaColor(RGB color) 

Source Link

Document

Sets the title bar color for this dialog.

Usage

From source file:com.ognize.jface.test.TitleAreaDialogTest.java

License:Open Source License

/**
 * @param args//from w w w.  j  av  a 2s .co m
 */
public static void main(String[] args) {
    /**
     * @j2sDebug window.defaultWindowLeft = 200;
     */
    {
    }
    final Display display = new Display();
    final Shell shell = new Shell(display);
    shell.setText("Test TitleAreaDialog");
    TitleAreaDialog dialog = new MyTitleAreaDialog(shell);
    dialog.setTitleAreaColor(new RGB(0xcc, 0xdd, 0xee));
    dialog.setBlockOnOpen(false);
    System.out.println("Hi...");
    //dialog.open();
    System.out.println("Hello...");
    //dialog.getShell().setImage(new Image(display, "j2slib/images/default.gif"));
    //      dialog.setTitle("hello");
    //      dialog.setMessage("Hello JFace World");
    //dialog.
    /**
     * @j2sNatives
     */
    {
        AsyncWindowProxy.open(dialog, new AsyncWindowRunnable() {
            public void run() {
                int ret = getWindow().getReturnCode();
                System.out.println("Hello!" + ret);
                System.out.println("Hello!" + getReturnCode());
                //            display.dispose();
                //            shell.dispose();
                //            Shell shell = new Shell(display);
                //            shell.setText("Test TitleAreaDialog");
                TitleAreaDialog dialog = new MyTitleAreaDialog(new Shell());
                dialog.setBlockOnOpen(false);
                //dialog.open();
                AsyncWindowProxy.open(dialog, new AsyncWindowRunnable() {
                    public void run() {
                        System.out.println("World!");
                    }
                });
            }
        });
    }
    shell.open();
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch())
            display.sleep();
    }
    display.dispose();

}