protected void showSmartDialog(String text) { Rectangle textBounds = m_text.getBounds(); Point location = m_text.toDisplay(new Point(0, textBounds.height)); Rectangle popupBounds = new Rectangle(location.x, location.y, textBounds.width, SWT.DEFAULT); m_smartDialog.open(popupBounds, text); }
protected void showSmartDialogLazy(String text) { Rectangle textBounds = m_text.getBounds(); Point location = m_text.toDisplay(new Point(0, textBounds.height)); Rectangle popupBounds = new Rectangle(location.x, location.y, textBounds.width, SWT.DEFAULT); m_smartDialog.lazyOpen(popupBounds, text); }
public static Text newShortTextInput(Composite parent, String title, int textLimit, int width) { Text t = newInput(parent, title, SWT.BORDER); t.setTextLimit(textLimit); Rectangle r = t.getBounds(); r.width = width; t.setBounds(r); t.setSize(width, r.height); t.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING)); return t; }
public Text newShortTextInput(int textLimit, int width) { Text t = newInput(this, null, SWT.BORDER); t.setTextLimit(textLimit); Rectangle r = t.getBounds(); r.width = width; t.setBounds(r); t.setSize(width, r.height); t.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING)); return t; }
void layoutShell() { Display display = txtQuickAccess.getDisplay(); Rectangle tempBounds = txtQuickAccess.getBounds(); Rectangle compBounds = display.map(txtQuickAccess, null, tempBounds); Rectangle shellBounds = txtQuickAccess.getShell().getBounds(); int preferredWidth = Math.max(MINIMUM_DIALOG_WIDTH, dialogWidth == -1 ? (int) (shellBounds.width * 0.6) : dialogWidth); int width = Math.max(preferredWidth, compBounds.width); int height = Math.max(MINIMUM_DIALOG_HEIGHT, dialogHeight == -1 ? (int) (shellBounds.height * 0.9) : dialogHeight); // If size would extend past the right edge of the shell, try to move it // to the left of the text if (compBounds.x + width > shellBounds.x + shellBounds.width){ compBounds.x = Math.max(shellBounds.x, (compBounds.x + compBounds.width - width)); } shell.setBounds(getConstrainedShellBounds(display, new Rectangle(compBounds.x, compBounds.y + compBounds.height, width, height))); shell.layout(); }
public void relocate(CellEditor celleditor) { Text text = (Text) celleditor.getControl(); Label label = namedEditPart.getNameLabelFigure(); if (text.getBounds().x <= 0) { super.relocate(celleditor); } else { org.eclipse.swt.graphics.Point sel = text.getSelection(); org.eclipse.swt.graphics.Point pref = text.computeSize(-1, -1); Rectangle rect = label.getTextBounds().getCopy(); label.translateToAbsolute(rect); text.setBounds(rect.x, rect.y-1, rect.width, pref.y+1); text.setSelection(0); text.setSelection(sel); } } }
current_shell.layout( true, true ); Rectangle bounds = text.getBounds();
+ gl_composite.marginHeight * 2 + gl_composite.verticalSpacing * 2; } else { dialogBounds.height = text.getBounds().height + +labelSeparator.getBounds().height + tableBounds.height + gl_composite.marginHeight * 2 + gl_composite.verticalSpacing * 2;
if (text.getBounds().x <= 0)