Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Button.computeSize()


    // This little code fragment is an attempt to get the right sizing for the buttons
    // Was wrong on Mac platforms
    //   Word below is the longer of the two words in the button container
    Button tempForSize = toolkit.createButton(tableContainer, "Remove", SWT.PUSH);
    Point p = tempForSize.computeSize(SWT.DEFAULT, SWT.DEFAULT);
    tempForSize.dispose();
   
    Composite bottomButtonContainer = newButtonContainer(tableContainer, HORIZONTAL_BUTTONS, 3* p.x);

    addButton = newPushButton(bottomButtonContainer, S_ADD,
View Full Code Here


        button.setText(JFaceResources.getString(key));
        button.setFont(parent.getFont());
        GridData data = new GridData(GridData.FILL_HORIZONTAL);
        int widthHint = convertHorizontalDLUsToPixels(button,
                IDialogConstants.BUTTON_WIDTH);
        data.widthHint = Math.max(widthHint, button.computeSize(SWT.DEFAULT,
                SWT.DEFAULT, true).x);
        button.setLayoutData(data);
        button.addSelectionListener(getSelectionListener());
        return button;
    }
View Full Code Here

            Button button = (Button) control;

            if (hasStyle(button, SWT.CHECK)) {
                return nonWrappingLabelData.copy();
            }
            return GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).hint(Geometry.max(button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true), LayoutConstants.getMinButtonSize()));
        }

        if (control instanceof Scrollable) {
            Scrollable scrollable = (Scrollable) control;
View Full Code Here

    // This little code fragment is an attempt to get the right sizing for the buttons
    // Was wrong on Mac platforms
    //   Word below is the longer of the two words in the button container
    Button tempForSize = toolkit.createButton(tableContainer, "Remove", SWT.PUSH);
    Point p = tempForSize.computeSize(SWT.DEFAULT, SWT.DEFAULT);
    tempForSize.dispose();
   
    Composite bottomButtonContainer = newButtonContainer(tableContainer, HORIZONTAL_BUTTONS, 3* p.x);

    addButton = newPushButton(bottomButtonContainer, S_ADD,
View Full Code Here

    // This little code fragment is an attempt to get the right sizing for the buttons
    // Was wrong on Mac platforms
    //   Word below is the longer of the two words in the button container
    Button tempForSize = toolkit.createButton(tableContainer, "Remove", SWT.PUSH);
    Point p = tempForSize.computeSize(SWT.DEFAULT, SWT.DEFAULT);
    tempForSize.dispose();
   
    Composite bottomButtonContainer = newButtonContainer(tableContainer, HORIZONTAL_BUTTONS, 3* p.x);

    addButton = newPushButton(bottomButtonContainer, S_ADD,
View Full Code Here

        button.setText(JFaceResources.getString(key));
        button.setFont(parent.getFont());
        GridData data = new GridData(GridData.FILL_HORIZONTAL);
        int widthHint = convertHorizontalDLUsToPixels(button,
                IDialogConstants.BUTTON_WIDTH);
        data.widthHint = Math.max(widthHint, button.computeSize(SWT.DEFAULT,
                SWT.DEFAULT, true).x);
        button.setLayoutData(data);
        button.addSelectionListener(getSelectionListener());
        return button;
    }
View Full Code Here

              {
                item.setText(col, combo.getText());
                Button a = new Button(incrementTable, SWT.PUSH);
                TableEditor editor = new TableEditor(incrementTable);
                a.setText("Delete");
                a.computeSize(SWT.DEFAULT, incrementTable.getItemHeight());

                editor.grabHorizontal = true;
                editor.minimumHeight = a.getSize().y;
                editor.minimumWidth = a.getSize().x;
View Full Code Here

                combo.dispose();
               
                Button a = new Button(valueSetTable, SWT.PUSH);
                TableEditor editor = new TableEditor(valueSetTable);
                a.setText("Delete");
                a.computeSize(SWT.DEFAULT, valueSetTable.getItemHeight());

                editor.grabHorizontal = true;
                editor.minimumHeight = a.getSize().y;
                editor.minimumWidth = a.getSize().x;
View Full Code Here

            TableItem tableItem = new TableItem(incrementTable, SWT.NONE);
            tableItem.setText(colls);
            Button a = new Button(incrementTable, SWT.PUSH);
            TableEditor editor = new TableEditor(incrementTable);
            a.setText("Delete");
            a.computeSize(SWT.DEFAULT, incrementTable.getItemHeight());

            editor.grabHorizontal = true;
            editor.minimumHeight = a.getSize().y;
            editor.minimumWidth = a.getSize().x;
View Full Code Here

            tableItem.setText(colls);
                       
            Button a = new Button(valueSetTable, SWT.PUSH);
            TableEditor editor = new TableEditor(valueSetTable);
            a.setText("Delete");
            a.computeSize(SWT.DEFAULT, valueSetTable.getItemHeight());

            editor.grabHorizontal = true;
            editor.minimumHeight = a.getSize().y;
            editor.minimumWidth = a.getSize().x;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.