Package org.eclipse.swt.widgets

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


        GC gc = new GC(label);
        FontMetrics fm = gc.getFontMetrics();

        int height = fm.getHeight();
        label.setSize(label.computeSize(labelWidth, height));

        useOptimiser = true;
        expensiveMethodCallCounter = 0;
        String textUsingOptimiser = getAvailableTextToDisplay(gc,
                label.getBounds(), labelMessage);
View Full Code Here


    label.setText(text);
    label.setFont(JFaceResources.getBannerFont());
    GridData data = new GridData();
    Monitor monitor = parent.getMonitor();
    int maxWidth = monitor.getBounds().width * 2 / 3;
    int width = label.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
    data.widthHint = Math.min(width, maxWidth);
    data.horizontalAlignment = GridData.FILL;
    data.grabExcessHorizontalSpace = true;
    data.horizontalIndent = 15;
    data.verticalIndent = 15;
View Full Code Here

      for (Map.Entry<String, String> entry : propertyValues.entrySet()) {
        GridData labelData = new GridData();
        labelData = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL);
        Label label = new Label(composite, SWT.NONE);
        label.setText(validationRule.getPropertyDescription(entry.getKey()) + ":");
        Point size = label.computeSize(SWT.DEFAULT, SWT.DEFAULT);
        labelData.widthHint = size.x;
        label.setLayoutData(labelData);

        Text text = new Text(composite, SWT.SINGLE | SWT.BORDER);
        text.setText(entry.getValue());
View Full Code Here

      for (Map.Entry<String, Integer> entry : messageSeverities.entrySet()) {
        GridData labelData = new GridData();
        labelData = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL);
        Label label = new Label(severityComposite, SWT.NONE);
        label.setText(validationRule.getMessageLabel(entry.getKey()) + ":");
        Point size = label.computeSize(SWT.DEFAULT, SWT.DEFAULT);
        labelData.widthHint = size.x;
        label.setLayoutData(labelData);

        Combo text = new Combo(severityComposite, SWT.SINGLE | SWT.BORDER | SWT.DROP_DOWN | SWT.READ_ONLY);
        text.setItems(new String[] { "Error", "Warning", "Info", "Ignore" });
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.