separator.moveAbove( label );
label.moveAbove( control );
protected String layoutBeforeChild( Control control, String labelText, String elementName, Map<String, String> attributes, Control container, SwtMetawidget metawidget ) { State state = getState( (Composite) container ); // Add label if ( SimpleLayoutUtils.needsLabel( labelText, elementName ) ) { Label label = new Label( (Composite) container, SWT.None ); // Required if ( attributes != null && TRUE.equals( attributes.get( REQUIRED ) ) && !WidgetBuilderUtils.isReadOnly( attributes ) && !metawidget.isReadOnly() ) { label.setText( labelText + "*" + StringUtils.SEPARATOR_COLON ); } else { label.setText( labelText + StringUtils.SEPARATOR_COLON ); } CC labelConstraints = new CC(); labelConstraints.cell( state.currentColumn * 2, state.currentRow ); labelConstraints.growX(); // Top align all labels, not just those belonging to 'tall' controls, // so that tall controls, regular controls and nested Metawidget // controls all line up labelConstraints.alignY( "top" ); // Apply some vertical padding so the label lines up with the control nicely labelConstraints.pad( state.defaultLabelVerticalPadding, 0, state.defaultLabelVerticalPadding, 0 ); // Add it label.setLayoutData( labelConstraints ); label.moveAbove( control ); } return labelText; }
protected void addLabel(String label, boolean highlight, int indent) { if (label == null) return; Label labelControl= createLabel(GRID_COLUMNS - 2, fControl.getParent(), label, indent); labelControl.moveAbove(fControl); if (highlight) fHighlight= PreferenceHighlight.addHighlight(labelControl, fControl, false); addChild(new PreferenceTreeNode<>(label, labelControl, true)); } }
public void freeze() { release(); if (sourceViewer instanceof SourceViewer) { Control viewerControl = ((SourceViewer) sourceViewer).getControl(); if (viewerControl instanceof Composite) { Composite composite = (Composite) viewerControl; Display display = composite.getDisplay(); // Flush pending redraw requests: while (!display.isDisposed() && display.readAndDispatch()) { } // Copy editor area: GC gc = new GC(composite); Point size; try { size = composite.getSize(); image = new Image(gc.getDevice(), size.x, size.y); gc.copyArea(image, 0, 0); } finally { gc.dispose(); gc = null; } // Persist editor area while executing refactoring: label = new Label(composite, SWT.NONE); label.setImage(image); label.setBounds(0, 0, size.x, size.y); label.moveAbove(null); } } }
rd.width = 8; spacer.setLayoutData(rd); spacer.moveAbove(null);
label.setImage(image); label.setBounds(0, 0, size.x, size.y); label.moveAbove(null);
label.setImage(image); label.setBounds(0, 0, size.x, size.y); label.moveAbove(null);
label.setImage(image); label.setBounds(0, 0, size.x, size.y); label.moveAbove(null);