Java Examples for org.eclipse.swt.layout.RowLayout

The following java examples will help you to understand the usage of org.eclipse.swt.layout.RowLayout. These source code samples are taken from different open source projects.

Example 1
Project: erlide-master  File: ControlPanelView.java View source code
private Composite createProcessCheckBoxes(final Composite parent) {
    final Composite container = new Composite(parent, SWT.NONE);
    container.setLayout(new RowLayout());
    TraceBackend.getInstance().removeAllProcessFlag();
    for (final ProcessFlag flag : ProcessFlag.values()) {
        final Button button = new Button(container, SWT.CHECK);
        button.setText(flag.getName());
        button.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(final SelectionEvent e) {
                if (button.getSelection()) {
                    TraceBackend.getInstance().addProcessFlag(flag);
                } else {
                    TraceBackend.getInstance().removeProcessFlag(flag);
                }
            }
        });
    }
    return container;
}
Example 2
Project: cdt-tests-runner-master  File: VisibilitySelectionPanel.java View source code
private void createAccessModifierComposite(Composite control) {
    accessModifierGroup = new Group(this, SWT.SHADOW_NONE);
    RowLayout groupLayout = new RowLayout(SWT.HORIZONTAL);
    groupLayout.fill = true;
    accessModifierGroup.setLayout(groupLayout);
    accessModifierGroup.setText(Messages.VisibilitySelectionPanel_AccessModifier);
    publicAccessRadioButton = new Button(accessModifierGroup, SWT.RADIO | SWT.LEFT);
    publicAccessRadioButton.setText(VisibilityEnum.v_public.toString());
    protectedAccessRadioButton = new Button(accessModifierGroup, SWT.RADIO | SWT.LEFT);
    protectedAccessRadioButton.setText(VisibilityEnum.v_protected.toString());
    privateAccessRadioButton = new Button(accessModifierGroup, SWT.RADIO | SWT.LEFT);
    privateAccessRadioButton.setText(VisibilityEnum.v_private.toString());
}
Example 3
Project: cdt-master  File: VisibilitySelectionPanel.java View source code
private void createAccessModifierComposite(Composite control) {
    accessModifierGroup = new Group(this, SWT.SHADOW_NONE);
    RowLayout groupLayout = new RowLayout(SWT.HORIZONTAL);
    groupLayout.fill = true;
    accessModifierGroup.setLayout(groupLayout);
    accessModifierGroup.setText(Messages.VisibilitySelectionPanel_AccessModifier);
    publicAccessRadioButton = new Button(accessModifierGroup, SWT.RADIO | SWT.LEFT);
    publicAccessRadioButton.setText(VisibilityEnum.v_public.toString());
    protectedAccessRadioButton = new Button(accessModifierGroup, SWT.RADIO | SWT.LEFT);
    protectedAccessRadioButton.setText(VisibilityEnum.v_protected.toString());
    privateAccessRadioButton = new Button(accessModifierGroup, SWT.RADIO | SWT.LEFT);
    privateAccessRadioButton.setText(VisibilityEnum.v_private.toString());
}
Example 4
Project: streamline-master  File: EditView.java View source code
private void createMenu(Composite inComp) {
    Composite menuComp = new Composite(inComp, SWT.NONE);
    menuComp.setLayout(new RowLayout());
    Button syncButt = new Button(parent, SWT.PUSH);
    syncButt.setText("Synch");
    syncButt.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent sev) {
            uploadRecord();
        }
    });
    Button newButt = new Button(parent, SWT.PUSH);
    newButt.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent sev) {
            TabItem[] items = tabFolder.getSelection();
            if (items != null && items.length != 0) {
                DataViewer viewer = (DataViewer) items[0].getControl();
                viewer.addEntry();
            }
        //				
        }
    });
    newButt.setText("New Entry");
}
Example 5
Project: liferay-ide-master  File: NewLayoutTplLayoutWizardPage.java View source code
protected void createSelectLayoutGroup(Composite parent) {
    SWTUtil.createLabel(parent, Msgs.selectInitialLayout, 1);
    // Composite group = SWTUtil.createTopComposite(parent, 4);
    // group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
    Composite group = new Composite(parent, SWT.NONE);
    GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
    gd.widthHint = 575;
    group.setLayoutData(gd);
    RowLayout rowLayout = new RowLayout();
    rowLayout.wrap = true;
    rowLayout.pack = false;
    group.setLayout(rowLayout);
    if (LAYOUT_PROPERTIES.length == layoutOptionsText.length && LAYOUT_PROPERTIES.length == layoutOptionsImages.length) {
        imagesToDispose = new ArrayList<Image>();
        for (int i = 0; i < LAYOUT_PROPERTIES.length; i++) {
            Image img = layoutOptionsImages[i].createImage();
            createLayoutOption(group, LAYOUT_PROPERTIES[i], layoutOptionsText[i], img);
            imagesToDispose.add(img);
        }
    }
}
Example 6
Project: tdq-studio-se-master  File: HideSeriesChartDialog.java View source code
private Composite createUtilityControl(Composite parent) {
    Composite comp = new Composite(parent, SWT.BORDER);
    comp.setLayout(new RowLayout());
    comp.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_GRAY));
    if (isCountAvgNull) {
        XYDataset dataset = chart.getXYPlot().getDataset();
        int count = dataset.getSeriesCount();
        for (int i = 0; i < count; i++) {
            Button checkBtn = new Button(comp, SWT.CHECK);
            checkBtn.setText(dataset.getSeriesKey(i).toString());
            checkBtn.setSelection(true);
            checkBtn.addSelectionListener(listener);
            checkBtn.setData(SERIES_KEY_ID, i);
        }
    }
    if (isMinMaxDate) {
        CategoryPlot plot = (CategoryPlot) chart.getPlot();
        CategoryDataset dataset = plot.getDataset();
        int count = dataset.getRowCount();
        for (int i = 0; i < count; i++) {
            Button checkBtn = new Button(comp, SWT.CHECK);
            checkBtn.setText(dataset.getRowKey(i).toString());
            checkBtn.setSelection(true);
            checkBtn.addSelectionListener(listener);
            checkBtn.setData(SERIES_KEY_ID, i);
        }
    }
    return comp;
}
Example 7
Project: LanguageBuddy-master  File: TagFilterComposite.java View source code
protected void init() {
    tree = new Tree(this, SWT.MULTI | SWT.CHECK);
    tree.setHeaderVisible(false);
    tree.setEnabled(true);
    tree.setLinesVisible(true);
    TreeColumn nameColumn = new TreeColumn(tree, SWT.NONE);
    nameColumn.setWidth(400);
    nameColumn.setResizable(true);
    nameColumn.setText(MessageUtil.getString("FilterColumn"));
    tree.showColumn(nameColumn);
    viewer = new CheckboxTreeViewer(tree);
    viewer.setCellEditors(new CellEditor[] { new CheckboxCellEditor() });
    contentProvider = new MetaDataContentProvider();
    labelProvider = new MetaDataLabelProvider(this.getDisplay());
    viewer.setContentProvider(contentProvider);
    viewer.setLabelProvider(labelProvider);
    viewer.addCheckStateListener(this);
    refresh();
    setContent(tree);
    setExpandHorizontal(true);
    setExpandVertical(true);
    if (getParent().getLayout() instanceof RowLayout) {
        RowData treeRowData = new RowData(SWT.DEFAULT, 200);
        setLayoutData(treeRowData);
    } else if (getParent().getLayout() instanceof GridLayout) {
        GridData treeGridData = new GridData(GridData.FILL);
        treeGridData.minimumHeight = 200;
        treeGridData.heightHint = 200;
        setLayoutData(treeGridData);
    }
    tree.setToolTipText(getTagPathDescription());
}
Example 8
Project: dltk.ruby-master  File: RubyTestingMainLaunchConfigurationTab.java View source code
protected void createTestEngineEditor(Composite parent, String text) {
    Label fTestEngine = new Label(parent, SWT.NONE);
    fTestEngine.setText(text);
    engineType = new Combo(parent, SWT.SINGLE | SWT.BORDER | SWT.DROP_DOWN);
    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    engineType.setLayoutData(gd);
    engineType.addModifyListener(getWidgetListener());
    detect = createPushButton(parent, DLTKTestingMessages.MainLaunchConfigurationTab_detectEngine, null);
    ITestingEngine[] engines = TestingEngineManager.getEngines(getNatureID());
    for (int i = 0; i < engines.length; i++) {
        String name = engines[i].getName();
        this.engineType.add(name);
        nameToId.put(name, engines[i].getId());
    }
    detect.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            handleDetectButtonSelected();
        }
    });
    // place holder
    new Label(parent, SWT.NONE);
    Composite engineStatusComposite = new Composite(parent, SWT.NONE);
    gd = new GridData();
    gd.horizontalSpan = ((GridLayout) parent.getLayout()).numColumns - 1;
    engineStatusComposite.setLayoutData(gd);
    engineStatusComposite.setLayout(new RowLayout());
    engineMessageImageLabel = new Label(engineStatusComposite, SWT.NONE);
    engineMessageLabel = new Label(engineStatusComposite, SWT.NONE);
}
Example 9
Project: pentaho-kettle-master  File: DatabaseDialogHarness.java View source code
private void showDialog() {
    XulDomContainer container = null;
    try {
        DatabaseConnectionDialog dcDialog = new DatabaseConnectionDialog();
        container = dcDialog.getSwtInstance(new Shell(SWT.NONE));
        if (database != null) {
            container.getEventHandler("dataHandler").setData(database);
        }
    } catch (XulException e) {
        e.printStackTrace();
    }
    XulRoot root = (XulRoot) container.getDocumentRoot().getRootElement();
    if (root instanceof XulDialog) {
        ((XulDialog) root).show();
    }
    if (root instanceof XulWindow) {
        ((XulWindow) root).open();
    }
    try {
        database = (DatabaseMeta) container.getEventHandler("dataHandler").getData();
    } catch (Exception e) {
        e.printStackTrace();
    }
    String message = DatabaseDialogHarness.setMessage(database);
    Shell shell = new Shell(SWT.DIALOG_TRIM);
    shell.setLayout(new RowLayout());
    Label label = new Label(shell, SWT.NONE);
    label.setText(message);
    Button button = new Button(shell, SWT.NONE);
    button.setText("Edit Database ...");
    button.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent event) {
            try {
                showDialog();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    });
    shell.pack();
    shell.open();
    while (!shell.isDisposed()) {
        if (!shell.getDisplay().readAndDispatch()) {
            shell.getDisplay().sleep();
        }
    }
}
Example 10
Project: platform_tools_motodev-master  File: MOTODEVVideosView.java View source code
@Override
protected Control createControl(Composite parent) {
    Composite toolbarComposite = new Composite(parent, SWT.NONE);
    toolbarComposite.setLayout(new RowLayout(SWT.HORIZONTAL));
    final Text searchText = new Text(toolbarComposite, SWT.SEARCH);
    searchText.setLayoutData(new RowData(150, SWT.DEFAULT));
    searchText.setMessage(VideosNLS.UI_Search);
    searchText.addModifyListener(new ModifyListener() {

        public void modifyText(ModifyEvent e) {
            searchAndFilter(searchText.getText());
        }
    });
    if (canPlayEmbeddedVideo()) {
        // recover the state, if there is flash player
        // if there is NO flash player, the checkbox is always selected
        boolean enablement = hasFlashPlayer();
        boolean selection = !enablement ? true : openExternalBrowser != null ? openExternalBrowser : false;
        final Button openExternal = new Button(toolbarComposite, SWT.CHECK);
        openExternal.setText(VideosNLS.UI_Open_External_Browser);
        openExternal.setToolTipText(VideosNLS.UI_Open_External_Browser);
        openExternal.setEnabled(enablement);
        openExternal.setSelection(selection);
        openExternalBrowser = selection;
        if (!enablement) {
            Label warningImg = new Label(toolbarComposite, SWT.NONE);
            warningImg.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_WARN_TSK));
            warningImg.setToolTipText(getNoFlashMessage());
        }
        openExternal.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
                openExternalBrowser = openExternal.getSelection();
            }
        });
    }
    return toolbarComposite;
}