@Override public void update() { browser.update(); }
@Override public void modifyText(ModifyEvent e) { if (okButton.isEnabled()) { return; } errorMessageLabel.setText(IInternalDebugCoreConstants.EMPTY_STRING); errorMessageLabel.getParent().update(); okButton.setEnabled(true); } }
protected void swt_vBarChanged() { if (DEBUG_SELECTION) { debug("vBar changed " + vBar.getSelection() + " via " + Debug.getCompressedStackTrace()); } swt_calculateClientArea(); cTable.update(); }
/** * Validates the input. * <p> * The default implementation of this framework method * delegates the request to the supplied input validator object; * if it finds the input invalid, the error message is displayed * in the dialog's message line. * This hook method is called whenever the text changes in the * input field. * </p> */ protected void validateInput() { String errorMessage = null; if (validator != null) { errorMessage = validator.isValid(text.getText()); } // Bug 16256: important not to treat empty string (blank error) the same as null (no error) errorMessageLabel.setText(errorMessage == null ? IInternalDebugCoreConstants.EMPTY_STRING : errorMessage); okButton.setEnabled(errorMessage == null); errorMessageLabel.getParent().update(); } @Override
/** * Sets the current error message or none if null * @param errorMessage the message to display * @since 3.3 */ public void setErrorMessage(String errorMessage) { fErrorMessage = errorMessage; if (fErrorTextWidget != null && !fErrorTextWidget.isDisposed()) { fErrorTextWidget.setText(errorMessage == null ? IInternalDebugCoreConstants.EMPTY_STRING : errorMessage); fErrorTextWidget.getParent().update(); // Access the ok button by id, in case clients have overridden button creation. // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=113643 Control button = getButton(IDialogConstants.OK_ID); if (button != null) { button.setEnabled(errorMessage == null); } } } }
@Override public void update() { super.update(); updateSize(); drawIndicators(); getParent().layout( true, true ); }
@Override public void widgetSelected(SelectionEvent e) { Button button = (Button) e.widget; Tag tag = (Tag) button.getData("Tag"); if (button.getGrayed()) { button.setGrayed(false); button.setSelection(!button.getSelection()); button.getParent().redraw(); } boolean doTag = button.getSelection(); trigger.tagButtonTriggered(tag, doTag); button.getParent().redraw(); button.getParent().update(); }
private void setErrorMessage(String errorMessage) { if (errorMessageText != null && !errorMessageText.isDisposed()) { errorMessageText.setText(errorMessage == null ? " \n " //$NON-NLS-1$ : errorMessage); boolean hasError = errorMessage != null && (StringConverter.removeWhiteSpaces(errorMessage)) .length() > 0; errorMessageText.setEnabled(hasError); errorMessageText.setVisible(hasError); errorMessageText.getParent().update(); Control button = getButton(IDialogConstants.OK_ID); if (button != null) { button.setEnabled(errorMessage == null); } } }
/** * Shows/hides advanced properties and it's controls. * * @param advanced * True if advanced should be shown, false otherwise. */ public void showAdvanced(boolean advanced) { advancedVisible = advanced; if (null != advancedText) { advancedText.setVisible(advanced); } if (CollectionUtils.isNotEmpty(propertyControls)) { for (AbstractPropertyControl<?, ?> propertyControl : propertyControls) { propertyControl.showIfAdvanced(advanced); } mainComposite.layout(); mainComposite.update(); if (allAdvancedProperties && !advancedVisible) { setMessage("This page contains only advanced properties.", INFORMATION); } else { updateMessage(); } } }
/** * Sets or clears the error message. If not <code>null</code>, the OK button is disabled. * * @param errorMessage the error message, or <code>null</code> to clear * @since 3.0 */ public void setErrorMessage(String errorMessage) { if (errorMessageText != null && !errorMessageText.isDisposed()) { errorMessageText.setText(errorMessage == null ? " " : errorMessage); //$NON-NLS-1$ boolean hasError= errorMessage != null && (StringConverter.removeWhiteSpaces(errorMessage)).length() > 0; errorMessageText.setEnabled(hasError); errorMessageText.setVisible(hasError); errorMessageText.getParent().update(); Control button= getButton(IDialogConstants.OK_ID); if (button != null) { button.setEnabled(errorMessage == null); } } }
/** * Sets or clears the error message. If not <code>null</code>, the OK button * is disabled. * * @param errorMessage the error message, or <code>null</code> to clear * @since 3.0 */ public void setErrorMessage(String errorMessage) { this.errorMessage = errorMessage; if (errorMessageText != null && !errorMessageText.isDisposed()) { errorMessageText.setText(errorMessage == null ? " \n " : errorMessage); //$NON-NLS-1$ // Disable the error message text control if there is no error, or // no error text (empty or whitespace only). Hide it also to avoid // color change. // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=130281 boolean hasError = errorMessage != null && (StringConverter.removeWhiteSpaces(errorMessage)).length() > 0; errorMessageText.setEnabled(hasError); errorMessageText.setVisible(hasError); errorMessageText.getParent().update(); // Access the ok button by id, in case clients have overridden // button creation. // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=113643 Control button = getButton(IDialogConstants.OK_ID); if (button != null) { button.setEnabled(errorMessage == null); } } }
/** * Sets or clears the error message. If not <code>null</code>, the OK button is disabled. * <P> * Copied from {@link org.eclipse.jface.dialogs.InputDialog} * * @param errorMessage * the error message, or <code>null</code> to clear */ public void setErrorMessage(String errorMessage) { this.errorMessage = errorMessage; if ((errorMessageText != null) && !errorMessageText.isDisposed()) { errorMessageText.setText(errorMessage == null ? " \n " : errorMessage); //$NON-NLS-1$ // Disable the error message text control if there is no error, or // no error text (empty or whitespace only). Hide it also to avoid // color change. // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=130281 boolean hasError = (errorMessage != null) && ((StringConverter.removeWhiteSpaces(errorMessage)).length() > 0); errorMessageText.setEnabled(hasError); errorMessageText.setVisible(hasError); errorMessageText.getParent().update(); // Access the ok button by id, in case clients have overridden button creation. // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=113643 Control button = getButton(IDialogConstants.OK_ID); if (button != null) { button.setEnabled(errorMessage == null); } } }
/** * Sets or clears the error message. * If not <code>null</code>, the OK button is disabled. * * @param errorMessage * the error message, or <code>null</code> to clear */ public void setErrorMessage(String errorMessage) { this.errorMessage = errorMessage; if (errorMessageText != null && !errorMessageText.isDisposed()) { errorMessageText.setText(errorMessage == null ? " \n " : errorMessage); //$NON-NLS-1$ // Disable the error message text control if there is no error, or // no error text (empty or whitespace only). Hide it also to avoid // color change. // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=130281 boolean hasError = errorMessage != null && (StringConverter.removeWhiteSpaces(errorMessage)).length() > 0; errorMessageText.setEnabled(hasError); errorMessageText.setVisible(hasError); errorMessageText.getParent().update(); // Access the ok button by id, in case clients have overridden button creation. // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=113643 Control button = getButton(IDialogConstants.OK_ID); if (button != null) { button.setEnabled(errorMessage == null); } } }
/** * Sets or clears the error message. * If not <code>null</code>, the OK button is disabled. * * @param errorMessage * the error message, or <code>null</code> to clear * @since 3.0 */ public void setErrorMessage(String errorMessage) { this.errorMessage = errorMessage; if (errorMessageText != null && !errorMessageText.isDisposed()) { errorMessageText.setText(errorMessage == null ? " \n " : errorMessage); //$NON-NLS-1$ // Disable the error message text control if there is no error, or // no error text (empty or whitespace only). Hide it also to avoid // color change. // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=130281 boolean hasError = errorMessage != null && (StringConverter.removeWhiteSpaces(errorMessage)).length() > 0; errorMessageText.setEnabled(hasError); errorMessageText.setVisible(hasError); errorMessageText.getParent().update(); // Access the ok button by id, in case clients have overridden button creation. // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=113643 Control button = getButton(IDialogConstants.OK_ID); if (button != null) { button.setEnabled(errorMessage == null); } } }
/** * Sets or clears the error message. * If not <code>null</code>, the OK button is disabled. * * @param errorMessage * the error message, or <code>null</code> to clear * @since 3.0 */ public void setErrorMessage(String errorMessage) { this.errorMessage = errorMessage; if (errorMessageText != null && !errorMessageText.isDisposed()) { errorMessageText.setText(errorMessage == null ? " \n " : errorMessage); //$NON-NLS-1$ // Disable the error message text control if there is no error, or // no error text (empty or whitespace only). Hide it also to avoid // color change. // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=130281 boolean hasError = errorMessage != null && (StringConverter.removeWhiteSpaces(errorMessage)).length() > 0; errorMessageText.setEnabled(hasError); errorMessageText.setVisible(hasError); errorMessageText.getParent().update(); // Access the ok button by id, in case clients have overridden button creation. // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=113643 Control button = getButton(IDialogConstants.OK_ID); if (button != null) { button.setEnabled(errorMessage == null); } } }
/** * Sets or clears the error message. * If not <code>null</code>, the OK button is disabled. * * @param errorMessage * the error message, or <code>null</code> to clear * @since 3.0 */ public void setErrorMessage(String errorMessage) { this.errorMessage = errorMessage; if (errorMessageText != null && !errorMessageText.isDisposed()) { errorMessageText.setText(errorMessage == null ? " \n " : errorMessage); //$NON-NLS-1$ // Disable the error message text control if there is no error, or // no error text (empty or whitespace only). Hide it also to avoid // color change. // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=130281 boolean hasError = errorMessage != null && (StringConverter.removeWhiteSpaces(errorMessage)).length() > 0; errorMessageText.setEnabled(hasError); errorMessageText.setVisible(hasError); errorMessageText.getParent().update(); // Access the ok button by id, in case clients have overridden button creation. // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=113643 Control button = getButton(IDialogConstants.OK_ID); if (button != null) { button.setEnabled(errorMessage == null); } } }
public void setErrorMessage(String errorMessage) { if (errorMessageText != null && !errorMessageText.isDisposed()) { errorMessageText.setText(errorMessage == null ? " \n " : errorMessage); //$NON-NLS-1$ // Disable the error message text control if there is no error, or // no error text (empty or whitespace only). Hide it also to avoid // color change. // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=130281 boolean hasError = errorMessage != null && (StringConverter.removeWhiteSpaces(errorMessage)).length() > 0; errorMessageText.setEnabled(hasError); errorMessageText.setVisible(hasError); errorMessageText.getParent().layout(); errorMessageText.getParent().update(); // Access the ok button by id, in case clients have overridden button creation. // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=113643 Control button = getButton(IDialogConstants.OK_ID); if (button != null) { button.setEnabled(errorMessage == null); } } }
@Override void update (boolean all) { // checkWidget (); /* * When there are many columns in a table, scrolling performance * can be improved by temporarily unsubclassing the window proc * so that internal messages are dispatched directly to the table. * If the application expects to see a paint event or has a child * whose font, foreground or background color might be needed, * the window proc cannot be unsubclassed. * * NOTE: The header tooltip can subclass the header proc so the * current proc must be restored or header tooltips stop working. */ int /*long*/ oldHeaderProc = 0, oldTableProc = 0; int /*long*/ hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0); boolean fixSubclass = isOptimizedRedraw (); if (fixSubclass) { oldTableProc = OS.SetWindowLongPtr (handle, OS.GWLP_WNDPROC, TableProc); oldHeaderProc = OS.SetWindowLongPtr (hwndHeader, OS.GWLP_WNDPROC, HeaderProc); } super.update (all); if (fixSubclass) { OS.SetWindowLongPtr (handle, OS.GWLP_WNDPROC, oldTableProc); OS.SetWindowLongPtr (hwndHeader, OS.GWLP_WNDPROC, oldHeaderProc); } }
public void mouseMove(MouseEvent e) { if (!draggingSashes) { // Set the cursor feedback List<SashRect> sashList = getSashRects(e.x, e.y); if (sashList.size() == 0) { host.setCursor(host.getDisplay().getSystemCursor( SWT.CURSOR_ARROW)); } else if (sashList.size() == 1) { if (sashList.get(0).container.isHorizontal()) host.setCursor(host.getDisplay().getSystemCursor( SWT.CURSOR_SIZEWE)); else host.setCursor(host.getDisplay().getSystemCursor( SWT.CURSOR_SIZENS)); } else { host.setCursor(host.getDisplay().getSystemCursor( SWT.CURSOR_SIZEALL)); } } else { adjustWeights(sashesToDrag, e.x, e.y); host.layout(); host.update(); } } });
@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