/** * Sets the minimal width of the buttons. Must be called after widget creation. */ public void setButtonsMinWidth(int minWidth) { if (fLastSeparator != null) { ((GridData) fLastSeparator.getLayoutData()).widthHint= minWidth; } }
/** * Sets the minimal width of the buttons. Must be called after widget creation. */ public void setButtonsMinWidth(int minWidth) { if (fLastSeparator != null) { ((GridData) fLastSeparator.getLayoutData()).widthHint= minWidth; } }
/** * Convenience method for showing or hiding a label by setting its <code>GridData.widthHint</code> * @param label * @param showIt */ private void showActionLabel(Label label, boolean showIt) { ((GridData) label.getLayoutData()).widthHint = (showIt) ? 16 : 0; }
/** * Sets the minimal width of the buttons. Must be called after widget creation. */ public void setButtonsMinWidth(int minWidth) { if (fLastSeparator != null) { ((GridData)fLastSeparator.getLayoutData()).widthHint= minWidth; } }
/** * Sets the minimal width of the buttons. Must be called after widget * creation. */ public void setButtonsMinWidth(int minWidth) { if (fLastSeparator != null) { ((GridData) fLastSeparator.getLayoutData()).widthHint = minWidth; } }
/** * Sets the minimal width of the buttons. Must be called after widget creation. */ public void setButtonsMinWidth(int minWidth) { if (fLastSeparator != null) { ((GridData) fLastSeparator.getLayoutData()).widthHint= minWidth; } }
/** * Sets the minimal width of the buttons. Must be called after widget creation. */ public void setButtonsMinWidth(int minWidth) { if (fLastSeparator != null) { ((GridData)fLastSeparator.getLayoutData()).widthHint= minWidth; } }
/** * Sets the minimal width of the buttons. Must be called after widget creation. */ public void setButtonsMinWidth(int minWidth) { if (fLastSeparator != null) { ((GridData)fLastSeparator.getLayoutData()).widthHint= minWidth; } }
/** * Sets the minimal width of the buttons. Must be called after widget creation. */ public void setButtonsMinWidth(int minWidth) { if (fLastSeparator != null) { ((GridData)fLastSeparator.getLayoutData()).widthHint= minWidth; } }
@Override protected void adjustForNumColumns(int numColumns) { GridData data = new GridData(); if (valueControl.getLayoutData() != null) { data = (GridData) valueControl.getLayoutData(); } data.horizontalSpan = numColumns - getNumberOfControls() + 1; valueControl.setLayoutData(data); }
@Override protected void adjustForNumColumns(int numColumns) { GridData data = new GridData(); if (valueControl.getLayoutData() != null) { data = (GridData) valueControl.getLayoutData(); } data.horizontalSpan = numColumns - getNumberOfControls() + 1; valueControl.setLayoutData(data); }
protected void adjustForNumColumns(int numColumns) { GridData data = new GridData(); if (valueControl.getLayoutData() != null) { data = (GridData) valueControl.getLayoutData(); } data.horizontalSpan = numColumns - getNumberOfControls() + 1; valueControl.setLayoutData(data); }
/** * New error message. * * @param twoCol the two col * @param span the span */ protected void newErrorMessage(Composite twoCol, int span) { Label m = new Label(twoCol, SWT.WRAP); m.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); ((GridData) m.getLayoutData()).horizontalSpan = span; ((GridData) m.getLayoutData()).widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); errorMessageUI = m; }
@Override protected void adjustForNumColumns(int numColumns) { GridData gd = (GridData) getLabelControl().getLayoutData(); gd.horizontalSpan = numColumns; } }
protected void createContentsForCreatingOrSavingGroup(Composite parent) { Group creatingOrSavingGroup = createGroup(parent, 2); creatingOrSavingGroup.setText(XMLUIMessages.Creating_or_saving_files); Label label = createLabel(creatingOrSavingGroup, XMLUIMessages.End_of_line_code_desc); ((GridData) label.getLayoutData()).horizontalSpan = 2; ((GridData) label.getLayoutData()).grabExcessHorizontalSpace = true; createLabel(creatingOrSavingGroup, XMLUIMessages.End_of_line_code); fEndOfLineCode = createDropDownBox(creatingOrSavingGroup); populateLineDelimiters(); }
/** * Computes the size needed by this page's UI control. * <p> * All pages should override this method and set the appropriate sizes * of their widgets, and then call <code>super.doComputeSize</code>. * </p> * * @return the size of the preference page encoded as * <code>new Point(width,height)</code> */ protected Point doComputeSize() { if (descriptionLabel != null && body != null) { Point bodySize = body.computeSize(SWT.DEFAULT, SWT.DEFAULT, true); GridData gd = (GridData) descriptionLabel.getLayoutData(); gd.widthHint = bodySize.x; } return getControl().computeSize(SWT.DEFAULT, SWT.DEFAULT, true); }
/** * Computes the size needed by this page's UI control. * <p> * All pages should override this method and set the appropriate sizes * of their widgets, and then call <code>super.doComputeSize</code>. * </p> * * @return the size of the preference page encoded as * <code>new Point(width,height)</code> */ protected Point doComputeSize() { if (descriptionLabel != null && body != null) { Point bodySize = body.computeSize(SWT.DEFAULT, SWT.DEFAULT, true); GridData gd = (GridData) descriptionLabel.getLayoutData(); gd.widthHint = bodySize.x; } return getControl().computeSize(SWT.DEFAULT, SWT.DEFAULT, true); }
@Override protected void adjustBounds() { // grow/shrink a wrappable Label's height to show its content as it changes Display display = getShell().getDisplay(); if (display != null && label != null) { Rectangle clientArea = display.getClientArea(); if (clientArea != null && clientArea.width > 0) { int workbenchWidth = clientArea.width; int currentHeight = label.getSize().y; int preferredHeight = label.computeSize(workbenchWidth, SWT.DEFAULT).y; if (currentHeight != preferredHeight) { GridData data = (GridData) label.getLayoutData(); data.heightHint = preferredHeight; getShell().pack(); } } } }
protected void createContentsForCreatingGroup(Composite parent) { Group creatingGroup = createGroup(parent, 2); creatingGroup.setText(XMLUIMessages.Creating_files); // Default extension for New file Wizard createLabel(creatingGroup, XMLUIMessages.XMLFilesPreferencePage_ExtensionLabel); fDefaultSuffix = createDropDownBox(creatingGroup); String[] validExtensions = (String[]) getValidExtensions().toArray(new String[0]); Arrays.sort(validExtensions); fDefaultSuffix.setItems(validExtensions); fDefaultSuffix.addSelectionListener(this); Label label = createLabel(creatingGroup, XMLUIMessages.Encoding_desc); ((GridData) label.getLayoutData()).horizontalSpan = 2; fEncodingSettings = new EncodingSettings(creatingGroup, XMLUIMessages.Encoding); ((GridData) fEncodingSettings.getLayoutData()).horizontalSpan = 2; }
public void createControl(Composite parent) { projectComposite = SWTUtils.createHVFillComposite(parent, 1); initializeDialogUnits(projectComposite); Label label = createLabel (projectComposite, TeamUIMessages.ExportProjectSetMainPage_SelectButton); GridData grid = (GridData) label.getLayoutData(); label.setData(grid); SashForm form = new SashForm(projectComposite, SWT.HORIZONTAL); form.setLayout(new FillLayout()); GridData data = new GridData(GridData.FILL_BOTH); form.setLayoutData(data); // Adds the working set table addWorkingSetSection(form); addProjectSection(form); form.setWeights(new int[] { 75, 25 }); addButtons(projectComposite); updateEnablement(); }