Eclipse RCP perspective maximization settings

Source: Internet
Author: User

To maximize the window after the RCP program is started, one of the methods is to overwrite the postwindowcreate () method of the parent class of the applicationworkbenchwindowadvisor class so that the window is automatically maximized after the application is started:

  1. /**
  2. * After the window is restored to the previously saved State (or a new window is created,
  3. * Before the window is opened (called ).
  4. */
  5. Public
     
    Void

    Postwindowcreate
    ()

    {

  6. Super
    .
    Postwindowcreate
    ()
    ;

  7. // Set the maximum window when opening

  8. Getwindowcycler
    ()
    .
    Getwindow
    ()
    .
    Getshell
    ()
    .
    Setmaximized
    (
    True
    )
    ;
  9. }

Alternatively, you can set the window size to the screen size when starting. Override the prewindowopen () method of the parent class of applicationworkbenchwindowadvisor class, and set the window size to the display screen size:

  1. Public

    Void

    Prewindowopen
    ()

    {

  2. Iworkbenchwindowconfigurer
     
    Cycler
    =
    Getwindowcycler
    ()
    ;

  3. // Obtain the screen size

  4. Rectangle
     
    Screensize
    =
    Display
    .
    Getdefault
    ()
    .
    Getclientarea
    ()
    ;

  5. // Initialize the window size

  6. Cycler
    .
    Setinitialsize
    (
    New
     
    Point
    (
    Screensize
    .
    Width
    ,
    Screensize
    .
    Height
    ))
    ;

  7. Cycler
    .
    Setshowcoolbar
    (
    False
    )
    ;

  8. Cycler
    .
    Setshowstatusline
    (
    False
    )
    ;

  9. // You can only minimize or close the window.

  10. Cycler
    .
    Setshellstyle
    (
    SWT
    .
    Min
    |
    SWT
    .
    Close
    )
    ;

  11. Cycler
    .
    Settitle
    (
    "
    Blog.javauu.com
    "
    )
    ;

  12. }
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.