Java Code Examples for org.eclipse.jface.resource.JFaceResources#getString()

The following examples show how to use org.eclipse.jface.resource.JFaceResources#getString() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CustomMessageDialog.java    From translationstudio8 with GNU General Public License v2.0 6 votes vote down vote up
private String getAccessibleMessageFor(Image image) {
	if (image.equals(getErrorImage())) {
		return JFaceResources.getString("error");//$NON-NLS-1$
	}

	if (image.equals(getWarningImage())) {
		return JFaceResources.getString("warning");//$NON-NLS-1$
	}

	if (image.equals(getInfoImage())) {
		return JFaceResources.getString("info");//$NON-NLS-1$
	}

	if (image.equals(getQuestionImage())) {
		return JFaceResources.getString("question"); //$NON-NLS-1$
	}

	return null;
}
 
Example 2
Source File: CustomMessageDialog.java    From tmxeditor8 with GNU General Public License v2.0 6 votes vote down vote up
private String getAccessibleMessageFor(Image image) {
	if (image.equals(getErrorImage())) {
		return JFaceResources.getString("error");//$NON-NLS-1$
	}

	if (image.equals(getWarningImage())) {
		return JFaceResources.getString("warning");//$NON-NLS-1$
	}

	if (image.equals(getInfoImage())) {
		return JFaceResources.getString("info");//$NON-NLS-1$
	}

	if (image.equals(getQuestionImage())) {
		return JFaceResources.getString("question"); //$NON-NLS-1$
	}

	return null;
}
 
Example 3
Source File: TSWizardDialog.java    From translationstudio8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates and return a new wizard closing dialog without opening it.
 * 
 * @return MessageDalog
 */
private MessageDialog createWizardClosingDialog() {
	MessageDialog result = new MessageDialog(getShell(),
			JFaceResources.getString("WizardClosingDialog.title"), //$NON-NLS-1$
			null,
			JFaceResources.getString("WizardClosingDialog.message"), //$NON-NLS-1$
			MessageDialog.QUESTION,
			new String[] { IDialogConstants.OK_LABEL }, 0) {
		protected int getShellStyle() {
			return super.getShellStyle() | SWT.SHEET;
		}
	};
	return result;
}
 
Example 4
Source File: TSWizardDialog.java    From tmxeditor8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates and return a new wizard closing dialog without opening it.
 * 
 * @return MessageDalog
 */
private MessageDialog createWizardClosingDialog() {
	MessageDialog result = new MessageDialog(getShell(),
			JFaceResources.getString("WizardClosingDialog.title"), //$NON-NLS-1$
			null,
			JFaceResources.getString("WizardClosingDialog.message"), //$NON-NLS-1$
			MessageDialog.QUESTION,
			new String[] { IDialogConstants.OK_LABEL }, 0) {
		protected int getShellStyle() {
			return super.getShellStyle() | SWT.SHEET;
		}
	};
	return result;
}
 
Example 5
Source File: MListEditor.java    From e4macs with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Helper method to create a push button.
 * 
 * @param parent the parent control
 * @param key the resource name used to supply the button's label text
 * @return Button
 */
private Button createPushButton(Composite parent, String key) {
    Button button = new Button(parent, SWT.PUSH);
    String buttonText = JFaceResources.getString(key);
    button.setText(buttonText);
    button.setFont(parent.getFont());
    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    int widthHint = convertHorizontalDLUsToPixels(button,
            IDialogConstants.BUTTON_WIDTH);
    data.widthHint = Math.max(widthHint, button.computeSize(SWT.DEFAULT,
            SWT.DEFAULT, true).x);
    button.setLayoutData(data);
    button.addSelectionListener(getSelectionListener());
    return button;
}
 
Example 6
Source File: PopupDialog.java    From SWET with MIT License 4 votes vote down vote up
PersistBoundsAction() {
	super(JFaceResources.getString("PopupDialog.persistBounds"), //$NON-NLS-1$
			IAction.AS_CHECK_BOX);
	setChecked(persistLocation && persistSize);
}
 
Example 7
Source File: PopupDialog.java    From SWET with MIT License 4 votes vote down vote up
PersistSizeAction() {
	super(JFaceResources.getString("PopupDialog.persistSize"), //$NON-NLS-1$
			IAction.AS_CHECK_BOX);
	setChecked(persistSize);
}
 
Example 8
Source File: PopupDialog.java    From SWET with MIT License 4 votes vote down vote up
PersistLocationAction() {
	super(JFaceResources.getString("PopupDialog.persistLocation"), //$NON-NLS-1$
			IAction.AS_CHECK_BOX);
	setChecked(persistLocation);
}
 
Example 9
Source File: StringFieldEditor.java    From birt with Eclipse Public License 1.0 3 votes vote down vote up
/**
 * Creates a string field editor. Use the method <code>setTextLimit</code>
 * to limit the text.
 * 
 * @param name
 *            the name of the preference this field editor works on
 * @param labelText
 *            the label text of the field editor
 * @param width
 *            the width of the text input field in characters, or
 *            <code>UNLIMITED</code> for no limit
 * @param strategy
 *            either <code>VALIDATE_ON_KEY_STROKE</code> to perform on the
 *            fly checking (the default), or
 *            <code>VALIDATE_ON_FOCUS_LOST</code> to perform validation
 *            only after the text has been typed in
 * @param parent
 *            the parent of the field editor's control
 * @since 2.0
 */
public StringFieldEditor( String name, String labelText, int width,
		int strategy, Composite parent )
{
	init( name, labelText );
	widthInChars = width;
	setValidateStrategy( strategy );
	isValid = false;
	errorMessage = JFaceResources.getString( "StringFieldEditor.errorMessage" );//$NON-NLS-1$
	createControl( parent );
}
 
Example 10
Source File: CustomizableFieldEditor.java    From Pydev with Eclipse Public License 1.0 3 votes vote down vote up
/**
 * Creates a string field editor. Use the method <code>setTextLimit</code> to limit the text.
 * 
 * @param name the name of the preference this field editor works on
 * @param labelText the label text of the field editor
 * @param width the width of the text input field in characters, or <code>UNLIMITED</code> for no limit
 * @param strategy either <code>VALIDATE_ON_KEY_STROKE</code> to perform on the fly checking (the default), or
 *            <code>VALIDATE_ON_FOCUS_LOST</code> to perform validation only after the text has been typed in
 * @param parent the parent of the field editor's control
 * @since 2.0
 */
public CustomizableFieldEditor(String name, String labelText, int width, int strategy, Composite parent) {
    init(name, labelText);
    widthInChars = width;
    setValidateStrategy(strategy);
    isValid = false;
    errorMessage = JFaceResources.getString("StringFieldEditor.errorMessage");//$NON-NLS-1$
    createControl(parent);
}