void layout() { Composite parent = canvas.getParent(); Rectangle rect = parent.getClientArea(); int width = 0; String[] items = list.getItems(); GC gc = new GC( list ); for ( int i = 0; i < objects.length; i++ ) { width = Math.max( width, gc.stringExtent( items[i] ).x ); } gc.dispose(); Point size1 = start.computeSize( SWT.DEFAULT, SWT.DEFAULT ); Point size2 = stop.computeSize( SWT.DEFAULT, SWT.DEFAULT ); Point size3 = check.computeSize( SWT.DEFAULT, SWT.DEFAULT ); Point size4 = label.computeSize( SWT.DEFAULT, SWT.DEFAULT ); width = Math.max( size1.x, Math.max( size2.x, Math.max( size3.x, width ) ) ); width = Math.max( 64, Math.max( size4.x, list.computeSize( width, SWT.DEFAULT ).x ) ); start.setBounds( 0, 0, width, size1.y ); stop.setBounds( 0, size1.y, width, size2.y ); check.setBounds( 0, size1.y + size2.y, width, size3.y ); label.setBounds( 0, rect.height - size4.y, width, size4.y ); int height = size1.y + size2.y + size3.y; list.setBounds( 0, height, width, rect.height - height - size4.y ); text.setBounds( width, 0, rect.width - width, rect.height ); canvas.setBounds( width, 0, rect.width - width, rect.height ); }
/** * Overridden to give the button the desired width. */ @Override public void create() { super.create(); final Button button = getButton( 0 ); final int newX = button.getBounds().x + button.getBounds().width - buttonWidth; button.setBounds( newX, button.getBounds().y, buttonWidth, button.getBounds().height ); } }
btnNewButton.setBounds(0, 0, 75, 25); btnNewButton.setText(RedisClient.i18nFile.getText(I18nFile.SUBSCRIBE));
btnNewButton.setBounds(0, 0, 75, 25); btnNewButton.setText(RedisClient.i18nFile.getText(I18nFile.PUBLISH)); btnNewButton.addSelectionListener(new SelectionAdapter() {
void resize() { Point pt = computeSize(SWT.DEFAULT, SWT.DEFAULT); int textWidth = pt.x - BUTTON_WIDTH; int buttonHeight = pt.y / 2; text.setBounds(0, 0, textWidth, pt.y); up.setBounds(textWidth, -3, BUTTON_WIDTH, buttonHeight); down.setBounds(textWidth, pt.y - buttonHeight - 3, BUTTON_WIDTH, buttonHeight); }
@Override public void layout(Composite editor, boolean force) { Rectangle bounds = editor.getClientArea(); Point size = button.computeSize(SWT.DEFAULT, SWT.DEFAULT, force); if (contents != null) { contents.setBounds(0, 0, bounds.width - size.x, bounds.height); } button.setBounds(bounds.width - size.x, 0, size.x, bounds.height); }
@Override public void layout(Composite editor, boolean force) { Rectangle bounds = editor.getClientArea(); Point size = button.computeSize(SWT.DEFAULT, SWT.DEFAULT, force); if (contents != null) { contents.setBounds(0, 0, bounds.width - size.x, bounds.height); } button.setBounds(bounds.width - size.x, 0, size.x, bounds.height); }
public void layout(Composite editor, boolean force) { Rectangle bounds = editor.getClientArea(); Point size = button.computeSize(SWT.DEFAULT, SWT.DEFAULT, force); if (contents != null) { contents.setBounds(0, 0, bounds.width - size.x, bounds.height); } button.setBounds(bounds.width - size.x, 0, size.x, bounds.height); }
public void layout(Composite editor, boolean force) { Rectangle bounds = editor.getClientArea(); Point size = _button.computeSize(SWT.DEFAULT, SWT.DEFAULT, force); // if (_wrapped != null) _wrapped.getControl().setBounds(0, 0, bounds.width - size.x, bounds.height); _button.setBounds(bounds.width - size.x, 0, size.x, bounds.height); }
wrap.setBounds(338, 105, 102, 28); wrap.setText("Wrap");
void internalLayout (boolean changed) { if (isDropped ()) dropDown (false); Rectangle rect = getClientArea (); int width = rect.width; int height = rect.height; Point arrowSize = arrow.computeSize (SWT.DEFAULT, height, changed); text.setBounds (0, 0, width - arrowSize.x, height); arrow.setBounds (width - arrowSize.x, 0, arrowSize.x, arrowSize.y); } void listEvent (Event event) {
void internalLayout (boolean changed) { if (isDropped ()) dropDown (false); Rectangle rect = getClientArea (); int width = rect.width; int height = rect.height; Point arrowSize = arrow.computeSize (SWT.DEFAULT, height, changed); text.setBounds (0, 0, width - arrowSize.x, height); arrow.setBounds (width - arrowSize.x, 0, arrowSize.x, arrowSize.y); } void listEvent (Event event) {
void internalLayout (boolean changed) { if (isDropped ()) dropDown (false); Rectangle rect = getClientArea (); int width = rect.width; int height = rect.height; Point arrowSize = arrow.computeSize (SWT.DEFAULT, height, changed); text.setBounds (0, 0, width - arrowSize.x, height); arrow.setBounds (width - arrowSize.x, 0, arrowSize.x, arrowSize.y); } void listEvent (Event event) {
void internalLayout (boolean changed) { if (isDropped ()) dropDown (false); Rectangle rect = getClientArea (); int width = rect.width; int height = rect.height; Point arrowSize = arrow.computeSize (SWT.DEFAULT, height, changed); text.setBounds (0, 0, width - arrowSize.x, height); arrow.setBounds (width - arrowSize.x, 0, arrowSize.x, arrowSize.y); } void listEvent (Event event) {
void internalLayout (boolean changed) { if (isDropped ()) dropDown (false); Rectangle rect = getClientArea (); int width = rect.width; int height = rect.height; Point arrowSize = arrow.computeSize (SWT.DEFAULT, height, changed); text.setBounds (0, 0, width - arrowSize.x, height); arrow.setBounds (width - arrowSize.x, 0, arrowSize.x, arrowSize.y); } void listEvent (Event event) {
String tt= fCopyDiffRightToLeftItem.getAction().getToolTipText(); fCenterButton.setToolTipText(tt); fCenterButton.setBounds(r); fCenterButton.setVisible(true); } else if (fRight.isEditable()) { String tt= fCopyDiffLeftToRightItem.getAction().getToolTipText(); fCenterButton.setToolTipText(tt); fCenterButton.setBounds(r); fCenterButton.setVisible(true); } else
topButtons[i].setBounds( bounds.width - (buttonW + spacing) * (topButtons.length - i), spacing,
fLeftToRightButton.setBounds(leftToRightBounds); fLeftToRightButton.setVisible(true); Rectangle rightToLeftBounds= new Rectangle(r.x, rightToLeftY, r.width, r.height); fRightToLeftButton.setBounds(rightToLeftBounds); fRightToLeftButton.setVisible(true); } else if (leftEditable) { fRightToLeftButton.setBounds(r); fRightToLeftButton.setVisible(true); fLeftToRightButton.setVisible(false); } else if (rightEditable) { fLeftToRightButton.setBounds(r); fLeftToRightButton.setVisible(true); fRightToLeftButton.setVisible(false);
@Override protected void layout(Composite composite, boolean flushCache) { Rectangle parentBounds = composite.getClientArea(); TableColumn[] columns = m_tableViewer.getTable().getColumns(); int[] colOrder = m_tableViewer.getTable().getColumnOrder(); int x = -m_tableViewer.getTable().getHorizontalBar().getSelection(); for (int i = 0; i < columns.length; i++) { TableColumn column = columns[colOrder[i]]; if (i == NlsTable.AMOUNT_UTILITY_COLS) { // layout button m_resetButton.setBounds(1, 1, x - 2, parentBounds.height - 2); } if (i >= NlsTable.AMOUNT_UTILITY_COLS) { Language lang = (Language) column.getData(NlsTable.LANGUAGE_COLUMN_ID); Text text = m_filterFields.get(lang); if (text != null) { text.setBounds(x + 1, 1, column.getWidth() - 2, parentBounds.height - 2); } } x += column.getWidth(); } composite.update(); } } // end P_FilterComponentLayout