Search in sources :

Example 11 with RowLayout

use of org.eclipse.swt.layout.RowLayout in project translationstudio8 by heartsome.

the class LicenseManageDialog method createActiveComp.

private void createActiveComp(Composite parent) {
    Group licenseIdGroup = new Group(parent, SWT.NONE);
    licenseIdGroup.setText(Messages.getString("license.LicenseManageDialog.licenseIdGroup"));
    GridData dataLicenseIdGroup = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL);
    dataLicenseIdGroup.heightHint = 110;
    licenseIdGroup.setLayoutData(dataLicenseIdGroup);
    GridLayout layoutGroup = new GridLayout(2, false);
    layoutGroup.marginLeft = 5;
    layoutGroup.marginHeight = 10;
    licenseIdGroup.setLayout(layoutGroup);
    Label label = new Label(licenseIdGroup, SWT.NONE);
    label.setText(Messages.getString("license.LicenseManageDialog.licenseIdLabel"));
    createIdInputComp(licenseIdGroup);
    Composite compLink = new Composite(licenseIdGroup, SWT.NONE);
    RowLayout layoutLink = new RowLayout();
    layoutLink.marginTop = 20;
    layoutLink.marginRight = 0;
    layoutLink.marginLeft = 0;
    layoutLink.marginBottom = 10;
    compLink.setLayout(layoutLink);
    GridData linkData = new GridData(GridData.FILL_HORIZONTAL);
    linkData.horizontalSpan = 2;
    compLink.setLayoutData(linkData);
    Label label1 = new Label(compLink, SWT.NONE);
    label1.setText(Messages.getString("license.LicenseManageDialog.label1"));
    if (!"L".equals(System.getProperty("TSEdition"))) {
        Label link1 = new Label(compLink, SWT.NONE);
        link1.setText(Messages.getString("license.LicenseManageDialog.link1"));
        link1.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLUE));
        link1.setCursor(cursor);
        link1.addMouseListener(new MouseListener() {

            public void mouseUp(MouseEvent e) {
            }

            public void mouseDown(MouseEvent e) {
                Program.launch(Messages.getString("license.LicenseManageDialog.urlr8buy") + "&PRODUCT=" + ProtectionFactory.getProduct() + "&PLATFORM=" + ProtectionFactory.getPlatform());
            }

            public void mouseDoubleClick(MouseEvent e) {
            }
        });
        Label label2 = new Label(compLink, SWT.NONE);
        label2.setText(Messages.getString("license.LicenseManageDialog.label2"));
    }
    Label link2 = new Label(compLink, SWT.NONE);
    link2.setText(Messages.getString("license.LicenseManageDialog.link2"));
    link2.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLUE));
    link2.setCursor(cursor);
    link2.addMouseListener(new MouseListener() {

        public void mouseUp(MouseEvent e) {
        }

        public void mouseDown(MouseEvent e) {
            Program.launch(Messages.getString("license.LicenseManageDialog.urlr8trial") + "&PRODUCT=" + ProtectionFactory.getProduct() + "&PLATFORM=" + ProtectionFactory.getPlatform());
        }

        public void mouseDoubleClick(MouseEvent e) {
        }
    });
    Label label3 = new Label(compLink, SWT.NONE);
    label3.setText(Messages.getString("license.LicenseManageDialog.label3"));
}
Also used : Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) MouseListener(org.eclipse.swt.events.MouseListener) MouseEvent(org.eclipse.swt.events.MouseEvent) Composite(org.eclipse.swt.widgets.Composite) RowLayout(org.eclipse.swt.layout.RowLayout) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label)

Example 12 with RowLayout

use of org.eclipse.swt.layout.RowLayout in project translationstudio8 by heartsome.

the class OfflineActiveDialog method createDialogArea.

@Override
protected Control createDialogArea(Composite parent) {
    Composite tparent = (Composite) super.createDialogArea(parent);
    GridLayout layout = new GridLayout();
    layout.marginWidth = 10;
    layout.marginTop = 10;
    tparent.setLayout(layout);
    GridDataFactory.fillDefaults().grab(true, true).applyTo(tparent);
    Composite compNav = new Composite(tparent, SWT.NONE);
    GridLayout navLayout = new GridLayout();
    compNav.setLayout(navLayout);
    createNavigation(compNav);
    Group groupLicenseId = new Group(tparent, SWT.NONE);
    groupLicenseId.setText(Messages.getString("license.OfflineActiveDialog.licenseIdGroup"));
    GridDataFactory.fillDefaults().grab(true, true).applyTo(groupLicenseId);
    GridLayout layoutGroup = new GridLayout(2, false);
    layoutGroup.marginLeft = 5;
    layoutGroup.marginHeight = 100;
    groupLicenseId.setLayout(layoutGroup);
    Label label = new Label(groupLicenseId, SWT.NONE);
    label.setText(Messages.getString("license.LicenseManageDialog.licenseIdLabel"));
    createIdInputComp(groupLicenseId);
    Composite compLink = new Composite(groupLicenseId, SWT.NONE);
    RowLayout layoutLink = new RowLayout();
    layoutLink.marginTop = 20;
    layoutLink.marginRight = 0;
    layoutLink.marginLeft = 0;
    layoutLink.marginBottom = 10;
    compLink.setLayout(layoutLink);
    GridData linkData = new GridData(GridData.FILL_HORIZONTAL);
    linkData.horizontalSpan = 2;
    compLink.setLayoutData(linkData);
    Label label1 = new Label(compLink, SWT.NONE);
    label1.setText(Messages.getString("license.LicenseManageDialog.label1"));
    if (!"L".equals(System.getProperty("TSEdition"))) {
        Label link1 = new Label(compLink, SWT.NONE);
        link1.setText(Messages.getString("license.LicenseManageDialog.link1"));
        link1.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLUE));
        link1.setCursor(cursor);
        link1.addMouseListener(new MouseListener() {

            public void mouseUp(MouseEvent e) {
            }

            public void mouseDown(MouseEvent e) {
                Program.launch(Messages.getString("license.LicenseManageDialog.urlr8buy") + "&PRODUCT=" + ProtectionFactory.getProduct() + "&PLATFORM=" + ProtectionFactory.getPlatform());
            }

            public void mouseDoubleClick(MouseEvent e) {
            }
        });
    } else {
        Label link2 = new Label(compLink, SWT.NONE);
        link2.setText(Messages.getString("license.LicenseManageDialog.link2"));
        link2.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLUE));
        link2.setCursor(cursor);
        link2.addMouseListener(new MouseListener() {

            public void mouseUp(MouseEvent e) {
            }

            public void mouseDown(MouseEvent e) {
                Program.launch(Messages.getString("license.LicenseManageDialog.urlr8trial") + "&PRODUCT=" + ProtectionFactory.getProduct() + "&PLATFORM=" + ProtectionFactory.getPlatform());
            }

            public void mouseDoubleClick(MouseEvent e) {
            }
        });
    }
    Label label3 = new Label(compLink, SWT.NONE);
    label3.setText(Messages.getString("license.LicenseManageDialog.label3"));
    return tparent;
}
Also used : Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) MouseListener(org.eclipse.swt.events.MouseListener) MouseEvent(org.eclipse.swt.events.MouseEvent) Composite(org.eclipse.swt.widgets.Composite) RowLayout(org.eclipse.swt.layout.RowLayout) Label(org.eclipse.swt.widgets.Label) GridData(org.eclipse.swt.layout.GridData)

Example 13 with RowLayout

use of org.eclipse.swt.layout.RowLayout in project translationstudio8 by heartsome.

the class OfflineActiveDialog method createNavigation.

private void createNavigation(Composite parent) {
    Label label = new Label(parent, SWT.NONE);
    label.setText(Messages.getString("license.OfflineActiveDialog.operatenavigation"));
    RowLayout layout = new RowLayout();
    Composite comp = new Composite(parent, SWT.NONE);
    comp.setLayout(layout);
    label = new Label(comp, SWT.NONE);
    label.setText(Messages.getString("license.OfflineActiveDialog.inputlicenseid"));
    label.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLUE));
    label = new Label(comp, SWT.NONE);
    label.setText(Messages.getString("license.OfflineActiveDialog.seperate"));
    label = new Label(comp, SWT.NONE);
    label.setText(Messages.getString("license.OfflineActiveDialog.getactivekey"));
    label = new Label(comp, SWT.NONE);
    label.setText(Messages.getString("license.OfflineActiveDialog.seperate"));
    label = new Label(comp, SWT.NONE);
    label.setText(Messages.getString("license.OfflineActiveDialog.getgrantfile"));
    label = new Label(comp, SWT.NONE);
    label.setText(Messages.getString("license.OfflineActiveDialog.seperate"));
    label = new Label(comp, SWT.NONE);
    label.setText(Messages.getString("license.OfflineActiveDialog.activefinish"));
}
Also used : Composite(org.eclipse.swt.widgets.Composite) RowLayout(org.eclipse.swt.layout.RowLayout) Label(org.eclipse.swt.widgets.Label)

Example 14 with RowLayout

use of org.eclipse.swt.layout.RowLayout in project azure-tools-for-java by Microsoft.

the class TableFileEditor method createToolbar.

private void createToolbar(Composite parent) {
    GridLayout gridLayout = new GridLayout(2, false);
    GridData gridData = new GridData();
    gridData.horizontalAlignment = SWT.FILL;
    gridData.grabExcessHorizontalSpace = true;
    Composite container = new Composite(parent, 0);
    container.setLayout(gridLayout);
    container.setLayoutData(gridData);
    queryTextField = new Text(container, SWT.LEFT | SWT.BORDER);
    gridData = new GridData(SWT.FILL, SWT.CENTER, true, true);
    queryTextField.setLayoutData(gridData);
    RowLayout rowLayout = new RowLayout();
    rowLayout.type = SWT.HORIZONTAL;
    rowLayout.wrap = false;
    Composite buttonsContainer = new Composite(container, SWT.NONE);
    buttonsContainer.setLayout(rowLayout);
    queryButton = new Button(buttonsContainer, SWT.PUSH);
    queryButton.setImage(Activator.getImageDescriptor("icons/Start.png").createImage());
    queryButton.setToolTipText(EXECUTE);
    refreshButton = new Button(buttonsContainer, SWT.PUSH);
    refreshButton.setImage(Activator.getImageDescriptor("icons/storagerefresh.png").createImage());
    refreshButton.setToolTipText(REFRESH);
    //        newEntityButton = new Button(buttonsContainer, SWT.PUSH);
    //        newEntityButton.setImage(Activator.getImageDescriptor("icons/add_entity.png").createImage());
    //        newEntityButton.setToolTipText("Add");
    deleteButton = new Button(buttonsContainer, SWT.PUSH);
    deleteButton.setImage(Activator.getImageDescriptor("icons/storagedelete.png").createImage());
    deleteButton.setToolTipText(DELETE);
    deleteButton.setEnabled(false);
    //        queryDesignerButton = new Button(buttonsContainer, SWT.PUSH);
    //        queryDesignerButton.setImage(Activator.getImageDescriptor("icons/query_builder.png").createImage());
    SelectionListener queryActionListener = new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            fileEditorVirtualNode.doAction(REFRESH);
        }
    };
    queryButton.addSelectionListener(queryActionListener);
    refreshButton.addSelectionListener(queryActionListener);
    deleteButton.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            fileEditorVirtualNode.doAction(DELETE);
        }
    });
//        newEntityButton.addSelectionListener(new SelectionAdapter() {
//            @Override
//            public void widgetSelected(SelectionEvent e) {
//                final TableEntityForm form = new TableEntityForm(PluginUtil.getParentShell(), "Add Entity");
//                form.setTableName(table.getName());
//                form.setStorageAccount(storageAccount);
//                form.setTableEntity(null);
//                form.setTableEntityList(tableEntities);
//
//                form.setOnFinish(new Runnable() {
//                    @Override
//                    public void run() {
//                        tableEntities.add(form.getTableEntity());
//
//                        refreshGrid();
//                    }
//                });
//                form.open();
//            }
//        });
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) Button(org.eclipse.swt.widgets.Button) RowLayout(org.eclipse.swt.layout.RowLayout) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Text(org.eclipse.swt.widgets.Text) SelectionListener(org.eclipse.swt.events.SelectionListener)

Example 15 with RowLayout

use of org.eclipse.swt.layout.RowLayout in project azure-tools-for-java by Microsoft.

the class BlobExplorerFileEditor method createButtons.

private void createButtons(Composite parent) {
    RowLayout rowLayout = new RowLayout();
    rowLayout.type = SWT.HORIZONTAL;
    rowLayout.wrap = false;
    Composite container = new Composite(parent, SWT.NONE);
    container.setLayout(rowLayout);
    queryButton = new Button(container, SWT.PUSH);
    queryButton.setImage(Activator.getImageDescriptor("icons/Start.png").createImage());
    queryButton.setToolTipText(SEARCH);
    refreshButton = new Button(container, SWT.PUSH);
    refreshButton.setImage(Activator.getImageDescriptor("icons/storagerefresh.png").createImage());
    refreshButton.setToolTipText(REFRESH);
    uploadButton = new Button(container, SWT.PUSH);
    uploadButton.setImage(Activator.getImageDescriptor("icons/storageupload.png").createImage());
    uploadButton.setToolTipText(UPLOAD_BLOB);
    deleteButton = new Button(container, SWT.PUSH);
    deleteButton.setImage(Activator.getImageDescriptor("icons/storagedelete.png").createImage());
    deleteButton.setToolTipText(DELETE_SELECTED_BLOB);
    deleteButton.setEnabled(false);
    //        openButton = new Button(container, SWT.PUSH);
    //        openButton.setImage(Activator.getImageDescriptor("icons/storageopen.png").createImage());
    //        openButton.setToolTipText("Open Blob");
    //        openButton.setEnabled(false);
    saveAsButton = new Button(container, SWT.PUSH);
    saveAsButton.setImage(Activator.getImageDescriptor("icons/storagesaveas.png").createImage());
    saveAsButton.setToolTipText(SAVE_AS);
    saveAsButton.setEnabled(false);
    SelectionListener queryAction = new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            fileEditorVirtualNode.doAction(SEARCH);
        }
    };
    refreshButton.addSelectionListener(queryAction);
    queryButton.addSelectionListener(queryAction);
    deleteButton.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            fileEditorVirtualNode.doAction(DELETE);
        }
    });
    saveAsButton.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            fileEditorVirtualNode.doAction(SAVE_AS);
        }
    });
    //        openButton.addSelectionListener(new SelectionAdapter() {
    //            @Override
    //            public void widgetSelected(SelectionEvent e) {
    //                downloadSelectedFile(true);
    //            }
    //        });
    uploadButton.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            fileEditorVirtualNode.doAction(UPLOAD_BLOB);
        }
    });
}
Also used : Composite(org.eclipse.swt.widgets.Composite) Button(org.eclipse.swt.widgets.Button) RowLayout(org.eclipse.swt.layout.RowLayout) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) SelectionListener(org.eclipse.swt.events.SelectionListener)

Aggregations

RowLayout (org.eclipse.swt.layout.RowLayout)56 Composite (org.eclipse.swt.widgets.Composite)51 Button (org.eclipse.swt.widgets.Button)39 GridData (org.eclipse.swt.layout.GridData)37 SelectionEvent (org.eclipse.swt.events.SelectionEvent)35 GridLayout (org.eclipse.swt.layout.GridLayout)32 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)30 Label (org.eclipse.swt.widgets.Label)26 Group (org.eclipse.swt.widgets.Group)19 Text (org.eclipse.swt.widgets.Text)11 Combo (org.eclipse.swt.widgets.Combo)9 SelectionListener (org.eclipse.swt.events.SelectionListener)8 ArrayList (java.util.ArrayList)6 RowData (org.eclipse.swt.layout.RowData)6 Event (org.eclipse.swt.widgets.Event)6 Listener (org.eclipse.swt.widgets.Listener)6 List (java.util.List)5 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)5 StyledText (org.eclipse.swt.custom.StyledText)5 Table (org.eclipse.swt.widgets.Table)5