private static void applyToStatusLine(DialogPage page, IStatus status) { String message = status.getMessage(); if (message != null && message.length() == 0) { message = null; } switch (status.getSeverity()) { case IStatus.OK: page.setMessage(message, IMessageProvider.NONE); page.setErrorMessage(null); break; case IStatus.WARNING: page.setMessage(message, IMessageProvider.WARNING); page.setErrorMessage(null); break; case IStatus.INFO: page.setMessage(message, IMessageProvider.INFORMATION); page.setErrorMessage(null); break; default: page.setMessage(null); page.setErrorMessage(message); break; } }
/** * Clears the normal message from the message line. */ protected void clearMessage() { if (page != null) { page.setMessage(null); } }
/** * Shows the given message in the page for this * field editor if it has one. * * @param msg the message */ protected void showMessage(String msg) { if (page != null) { page.setErrorMessage(msg); } }
@Override public void dispose() { writeConfiguration(); super.dispose(); }
@Override public void setVisible(boolean visible) { super.setVisible(visible); searchText.setFocus(); container.setPerformActionEnabled(true); }
/** * Returns the default font to use for this dialog page. * * @return the font */ protected Font getFont() { return JFaceResources.getFontRegistry().get(getDialogFontName()); }
/** * Returns this dialog page's shell. Convenience method for * <code>getControl().getShell()</code>. This method may only be called * after the page's control has been created. * * @return the shell */ public Shell getShell() { return getControl().getShell(); }
/** * Sets the <code>GridData</code> on the specified button to be one that * is spaced for the current dialog page units. The method * <code>initializeDialogUnits</code> must be called once before calling * this method for the first time. * * @param button * the button to set the <code>GridData</code> * @return the <code>GridData</code> set on the specified button */ protected GridData setButtonLayoutData(Button button) { GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL); int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH); Point minSize = button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true); data.widthHint = Math.max(widthHint, minSize.x); button.setLayoutData(data); return data; }
/** * Sets or clears the message for this page. * <p> * This is a shortcut for <code>setMessage(newMesasge, NONE)</code> * </p> * * @param newMessage * the message, or <code>null</code> to clear the message */ public void setMessage(String newMessage) { setMessage(newMessage, NONE); }
/** * Clears the error message from the message line. */ protected void clearErrorMessage() { if (page != null) { page.setErrorMessage(null); } }
@Override public void dispose() { writeConfiguration(); super.dispose(); }
@Override public void setVisible(boolean visible) { if (visible && patternCombo != null) { if (firstTime) { firstTime = false; String[] patterns = new String[previousQueries.size()]; for (int i = previousQueries.size() - 1, j = 0; i >= 0; i--, j++) { patterns[j] = previousQueries.get(i).text; } patternCombo.setItems(patterns); initSelections(); container.setPerformActionEnabled(patternCombo.getText().length() > 0); } patternCombo.setFocus(); } IEditorInput editorInput = container.getActiveEditorInput(); container.setActiveEditorCanProvideScopeSelection(editorInput != null && editorInput.getAdapter(IFile.class) != null); super.setVisible(visible); }
/** * Returns the default font to use for this dialog page. * * @return the font */ protected Font getFont() { return JFaceResources.getFontRegistry().get(getDialogFontName()); }
/** * Returns this dialog page's shell. Convenience method for * <code>getControl().getShell()</code>. This method may only be called * after the page's control has been created. * * @return the shell */ public Shell getShell() { return getControl().getShell(); }
/** * Sets the <code>GridData</code> on the specified button to be one that * is spaced for the current dialog page units. The method * <code>initializeDialogUnits</code> must be called once before calling * this method for the first time. * * @param button * the button to set the <code>GridData</code> * @return the <code>GridData</code> set on the specified button */ protected GridData setButtonLayoutData(Button button) { GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL); int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH); Point minSize = button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true); data.widthHint = Math.max(widthHint, minSize.x); button.setLayoutData(data); return data; }
private void applyToStatusLine(DialogPage page, IStatus status) { String message = status.getMessage(); switch (status.getSeverity()) { case IStatus.OK: page.setMessage(message, IMessageProvider.NONE); page.setErrorMessage(null); break; case IStatus.WARNING: page.setMessage(message, IMessageProvider.WARNING); page.setErrorMessage(null); break; case IStatus.INFO: page.setMessage(message, IMessageProvider.INFORMATION); page.setErrorMessage(null); break; default: if (message.length() == 0) { message = null; } page.setMessage(null); page.setErrorMessage(message); break; } }
/** * Clears the normal message from the message line. */ protected void clearMessage() { if (page != null) { page.setMessage(null); } }
/** * Shows the given message in the page for this * field editor if it has one. * * @param msg the message */ protected void showMessage(String msg) { if (page != null) { page.setErrorMessage(msg); } }
@Override public void dispose() { writeConfiguration(); super.dispose(); }
public void setVisible(boolean visible) { if (visible && fPattern != null) { if (fFirstTime) { fFirstTime= false; // Set item and text here to prevent page from resizing fPattern.setItems(getPreviousSearchPatterns()); initSelections(); } fPattern.setFocus(); } updateOKStatus(); super.setVisible(visible); }