@Override
    protected Control createContents(Composite parent) {
        Composite container = new Composite(parent, SWT.NONE);
        container.setLayout(new FormLayout());

        browser = new Browser(container, SWT.NONE);
        FormData fd_browser = new FormData();
        fd_browser.top = new FormAttachment(0, 10);
        fd_browser.left = new FormAttachment(0, 10);
        fd_browser.right = new FormAttachment(100, -10);
        browser.setLayoutData(fd_browser);

        browser.setText(Transformer.transform("test.gui"));
        rootComponent = Transformer.component;

        new BrowserFunction(browser, "log") {
            @Override
            public Object function(Object[] arguments) {
                System.out.println((String) arguments[0]);
                return null;
            }
        };

        composite = new Composite(container, SWT.NONE);
        fd_browser.bottom = new FormAttachment(100, -162);
        FormData fd_composite = new FormData();
        fd_composite.top = new FormAttachment(browser, 6);
        fd_composite.left = new FormAttachment(0, 10);
        fd_composite.bottom = new FormAttachment(100, -10);
        fd_composite.right = new FormAttachment(0, 176);
        composite.setLayoutData(fd_composite);
        composite.setLayout(new GridLayout(3, false));

        Label elementLabel = new Label(composite, SWT.NONE);
        elementLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
        elementLabel.setText("Element");

        elementText = new Text(composite, SWT.BORDER | SWT.READ_ONLY);
        elementText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));

        Label xLabel = new Label(composite, SWT.NONE);
        xLabel.setText("X");
        xLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));

        xText = new Spinner(composite, SWT.BORDER | SWT.READ_ONLY);
        xText.setMaximum(1000);
        xText.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
        xText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));

        Label label_2 = new Label(composite, SWT.NONE);
        label_2.setText("px");

        Label yLabel = new Label(composite, SWT.NONE);
        yLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
        yLabel.setText("Y");

        yText = new Spinner(composite, SWT.BORDER | SWT.READ_ONLY);
        yText.setMaximum(1000);
        yText.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
        yText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));

        Label label_1 = new Label(composite, SWT.NONE);
        label_1.setText("px");

        Label widthLabel = new Label(composite, SWT.NONE);
        widthLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
        widthLabel.setText("Width");

        widthText = new Spinner(composite, SWT.BORDER | SWT.READ_ONLY);
        widthText.setMaximum(1000);
        widthText.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
        widthText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));

        Label label = new Label(composite, SWT.NONE);
        label.setText("px");

        Label heightLabel = new Label(composite, SWT.NONE);
        heightLabel.setText("Height");

        heightText = new Spinner(composite, SWT.BORDER | SWT.READ_ONLY);
        heightText.setMaximum(1000);
        heightText.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
        GridData gd_heightText = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
        gd_heightText.widthHint = 76;
        heightText.setLayoutData(gd_heightText);

        Label lblNewLabel = new Label(composite, SWT.NONE);
        lblNewLabel.setText("px");

        URL mainScriptUrl = Resources.getResource("script/main.js");
        try {
          mainScript = Resources.toString(mainScriptUrl, Charset.defaultCharset());
        } catch (IOException e1) {
            e1.printStackTrace();
        }

        browser.addMouseListener(new MouseAdapter() {
            @Override
            public void mouseUp(MouseEvent e) {
                String id = (String) browser.evaluate("return document.activeElement.id");
                String x = (String) browser.evaluate("return document.activeElement.style.left");
                String y = (String) browser.evaluate("return document.activeElement.style.top");
                String width = (String) browser.evaluate("return document.activeElement.style.width");
                String height = (String) browser.evaluate("return document.activeElement.style.height");

                if (id == null) {
                    return;
                }

                elementText.setText(id.replace("px", " px"));
                xText.setSelection(Integer.parseInt(x.replace("px", "")));
                yText.setSelection(Integer.parseInt(y.replace("px", "")));
                widthText.setSelection(Integer.parseInt(width.replace("px", "")));
                heightText.setSelection(Integer.parseInt(height.replace("px", "")));

                Component c = getSelectedComponent();
                if (!c.getName().equals(id)) {
                    c = rootComponent.find(id);
                }
                c.properties.put("x", "" + xText.getSelection());
                c.properties.put("y", "" + yText.getSelection());
                c.properties.put("width", "" + widthText.getSelection());
                c.properties.put("height", "" + heightText.getSelection());
                System.out.println(c.properties);
            }

            @Override
            public void mouseDown(MouseEvent e) {
                ignoreModify = true;
            }
        });

        xText.addModifyListener(new ModifyListener() {
            public void modifyText(ModifyEvent event) {
                if (ignoreModify) {
                    return;
                }
                String id = (String) browser.evaluate("return document.activeElement.id");
                browser.evaluate("$('#" + id + "').css('left', " + xText.getSelection() + ");");

                Component c = getSelectedComponent();
                c.properties.put("x", "" + xText.getSelection());
                System.out.println(c.getName() + " : x = " + c.properties.get("x"));
            }
        });

        xText.addMouseListener(new MouseAdapter() {
            @Override
            public void mouseDown(MouseEvent e) {
                ignoreModify = false;
            }
        });

        yText.addModifyListener(new ModifyListener() {
            public void modifyText(ModifyEvent event) {
                if (ignoreModify) {
                    return;
                }
                String id = (String) browser.evaluate("return document.activeElement.id");
                browser.evaluate("$('#" + id + "').css('top', " + yText.getSelection() + ");");

                Component c = getSelectedComponent();
                c.properties.put("y", "" + yText.getSelection());
                System.out.println(c.getName() + " : y = " + c.properties.get("y"));
            }
        });

        yText.addMouseListener(new MouseAdapter() {
            @Override
            public void mouseDown(MouseEvent e) {
                ignoreModify = false;
            }
        });

        widthText.addModifyListener(new ModifyListener() {
            public void modifyText(ModifyEvent event) {
                if (ignoreModify) {
                    return;
                }
                String id = (String) browser.evaluate("return document.activeElement.id");
                browser.evaluate("$('#" + id + "').css('width', " + widthText.getSelection() + ");");

                Component c = getSelectedComponent();
                c.properties.put("width", "" + widthText.getSelection());
                System.out.println(c.getName() + " : width = " + c.properties.get("width"));
            }
        });

        widthText.addMouseListener(new MouseAdapter() {
            @Override
            public void mouseDown(MouseEvent e) {
                ignoreModify = false;
            }
        });

        heightText.addModifyListener(new ModifyListener() {
            public void modifyText(ModifyEvent event) {
                if (ignoreModify) {
                    return;
                }
                String id = (String) browser.evaluate("return document.activeElement.id");
                browser.evaluate("$('#" + id + "').css('height', " + heightText.getSelection() + ");");

                Component c = getSelectedComponent();
                c.properties.put("height", "" + heightText.getSelection());
                System.out.println(c.getName() + " : height = " + c.properties.get("height"));
            }
        });

        heightText.addMouseListener(new MouseAdapter() {
            @Override
            public void mouseDown(MouseEvent e) {
                ignoreModify = false;
            }
        });

        return container;
    }