Remove or customize the close/minimize/maximize button in an eclipse-rcp's application's window
Tech-Today

Remove or customize the close/minimize/maximize button in an eclipse-rcp's application's window


There are times when you just want your eclipse rcp in the middle of the screen. To do that you have to set the style bits for the window's shell to customize the look of your window.

The API is accessible here: http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/index.html, the setShellStyle method. It accepts different parameters such as SWT.CLOSE, SWT.MIN, SWT.MAX, SWT.TITLE, etc. For example we only want the Title in the window we will call the method like this:

configurer.setShellStyle(SWT.TITLE);

You can try several variations, another example is if you only want the close and the minimum buttons:

configurer.setShellStyle(SWT.TITLE | SWT.CLOSE | SWT.MIN);

For more style bits look at the SWT class API, and see what other values you can use.

BTW, always remember that: "This method has no effect after the shell is created. That is, it must be called within the preWindowOpen  callback on WorkbenchAdvisor." [eclipse.org api]

public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
    public ApplicationWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
        super(configurer);
    }

    public ActionBarAdvisor createActionBarAdvisor(IActionBarConfigurer configurer) {
        return new ApplicationActionBarAdvisor(configurer);
    }
    
    public void preWindowOpen() {
        IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
        configurer.setShellStyle(SWT.TITLE | SWT.CLOSE | SWT.MIN);
        configurer.setShowCoolBar(false);
        configurer.setShowStatusLine(false);
        configurer.setTitle("Administrator Tool");
    }
}




- How To Display A Date With Textfield Click With Swift
Displaying Date with TextField Click with Swift First you must have a textfield connected to storyboard. @IBOutlet weak var txtField_helloDatePicker: UITextField! Next you should have a constant of UIDatePicker type. let datePicker...

- How To Handle Checkbox Event In Swift
A very simple checkbox control.  @IBAction func btn_box(sender: UIButton) {        if (btn_box.selected == true)        {            btn_box.setBackgroundImage(UIImage(named: "box"),...

- Useful Article Links In Studying Swift
1.) For studying the basic of swift :      file:///Users/czetsuya/Downloads/404_advanced_swift.pdf-,%20attachment 2.) Useful for studying "Case Classes"      http://masteringios.com/blog/2014/06/26/hello-swift/2/ 3.) “Building...

- How To Access Asp:textbox With Runat=server Attribute In Javascript
For example you have a textbox which has a default value, and you want to clear that value when the user click on the textbox: <asp:TextBox ID="txtBox" runat="server" onclick="clear()" Text="Enter Keyword" /> <script type="text/javascript">...

- Create A New Eclipse-rcp Preference Page By Code When A Listener Is Invoked
Objective: -To create an eclipse-rcp preference page without using the preference extension, all is done in code. This is done by creating a customized button with a SelectionListener, and eventually that action will call a customized preference page....



Tech-Today








.