On the visual editor available in Eclipse RCP

Source: Internet
Author: User

In the development of RCP, there is a visual editor, of course, can play a multiplier effect. For invoicing management system such a simple program, the View Plus dialog box can handle all the program features, but for the View and dialog box control, if there is no visual editor help, enough to make developers burn. However, the choice of the visual editor of the road is bumpy, I am here to write out my experience, I hope to have a little help.

First to say ve, I think we all think of the visual editor when the first will think of VE. I'm here to tell you that you don't have to think about this editor, you don't have to waste time on it. Why do you say that? First, the official version of the editor is the 1.2.3_jem version of January 30, 2007, which only supports Eclipse3.2 and does not support 3.4. Of course, there is an unofficial version 1.4 can be used, its installation address is http://update.soyatec.org/Ganymede/ve/1.4, can be installed through the ECLISPE update function. However, this 1.4 version of performance than the 1.2.3 version of the worse, it incredibly in the editing Viewpart will be wrong, edit dialog is not a problem, but it is very bad use, change a layout is difficult.

So I think everyone's preferred object should be swt-designer, but want money, and very expensive, is 239 dollars, if it is 239 yuan, I will not hesitate to buy it, but the dollar, that is another matter. But if you are a company that specializes in RCP development, you can think about it, but I think most of the RCP development should be our amateurs. For me, basically is can not spend money, do not register and activation, use it, although only three days, but three days after the deletion of the user directory of Instantiations.license files, and can start again.

But don't be too early, the free version actually has functional limitations. For example, if you want to create a dialog box, you can't create it. But I found that if I manually write a dialog box code, but can use Swt-designer edit, for Eclispe automatically generated view class, you can also edit. This function is enough for me.

You're not just writing a dialog box class can be edited with Swt-designer, and if it can be parsed by a visual editor, the dialog class must have the following form:

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Dialog;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.events.ShellAdapter;
import org.eclipse.swt.events.ShellEvent;

public class LoginDialog extends Dialog {
    protected Shell shell;
    private int result;

    public LoginDialog(Shell parent, int style) {
        super(parent, style);
    }

    public LoginDialog(Shell parent) {
        super(parent);
    }

    public int open(){
        createContents();
        return result;
    }

    protected void  createContents(){
        //注意下面这一行创建Shell时的参数,想一想我前面讲的模式对话框的概念
        shell = new Shell(getParent(), SWT.DIALOG_TRIM |  SWT.APPLICATION_MODAL);
    }

}

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.