View | Details | Raw Unified | Return to bug 109445 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/gmf/runtime/common/ui/services/properties/extended/ExtendedBooleanPropertyDescriptor.java (-10 / +7 lines)
Lines 11-22 Link Here
11
11
12
package org.eclipse.gmf.runtime.common.ui.services.properties.extended;
12
package org.eclipse.gmf.runtime.common.ui.services.properties.extended;
13
13
14
import org.eclipse.gmf.runtime.common.ui.services.properties.internal.l10n.CommonUiServicesPropertiesMessages;
14
import org.eclipse.jface.viewers.ILabelProvider;
15
import org.eclipse.jface.viewers.ILabelProvider;
15
import org.eclipse.jface.viewers.LabelProvider;
16
import org.eclipse.jface.viewers.LabelProvider;
16
17
17
import org.eclipse.gmf.runtime.common.ui.services.properties.internal.l10n.PSFResourceManager;
18
19
20
/**
18
/**
21
 * @author Tauseef A. Israr
19
 * @author Tauseef A. Israr
22
 * Created on: Sep 9, 2002
20
 * Created on: Sep 9, 2002
Lines 24-33 Link Here
24
public class ExtendedBooleanPropertyDescriptor
22
public class ExtendedBooleanPropertyDescriptor
25
	extends ExtendedComboboxPropertyDescriptor {
23
	extends ExtendedComboboxPropertyDescriptor {
26
24
27
	private static final String TRUE = PSFResourceManager.getI18NString("ExtendedBooleanPropertyDescriptor.True"); //$NON-NLS-1$
28
29
	private static final String FALSE = PSFResourceManager.getI18NString("ExtendedBooleanPropertyDescriptor.False"); //$NON-NLS-1$
30
31
	/**
25
	/**
32
	 * Constructor for ExtendedBooleanPropertyDescriptor.
26
	 * Constructor for ExtendedBooleanPropertyDescriptor.
33
	 * 
27
	 * 
Lines 35-41 Link Here
35
	 * @param displayName
29
	 * @param displayName
36
	 */
30
	 */
37
	public ExtendedBooleanPropertyDescriptor(Object id, String displayName) {
31
	public ExtendedBooleanPropertyDescriptor(Object id, String displayName) {
38
		super(id, displayName, new String[] { FALSE, TRUE });
32
		super(id, displayName, new String[] { 
33
			CommonUiServicesPropertiesMessages.ExtendedBooleanPropertyDescriptor_False, 
34
			CommonUiServicesPropertiesMessages.ExtendedBooleanPropertyDescriptor_True 
35
		});
39
	}
36
	}
40
37
41
	/**
38
	/**
Lines 46-54 Link Here
46
			public String getText(Object object) {
43
			public String getText(Object object) {
47
				if (object instanceof Integer) {
44
				if (object instanceof Integer) {
48
					if (((Integer) object).intValue() == 0)
45
					if (((Integer) object).intValue() == 0)
49
						return FALSE;
46
						return CommonUiServicesPropertiesMessages.ExtendedBooleanPropertyDescriptor_False;
50
					else if (((Integer) object).intValue() == 1)
47
					else if (((Integer) object).intValue() == 1)
51
						return TRUE;
48
						return CommonUiServicesPropertiesMessages.ExtendedBooleanPropertyDescriptor_True;
52
				}
49
				}
53
				return (String) getBlank();
50
				return (String) getBlank();
54
			}
51
			}
(-)src/org/eclipse/gmf/runtime/common/ui/services/properties/extended/ExtendedPropertyDescriptor.java (-7 / +2 lines)
Lines 11-22 Link Here
11
11
12
package org.eclipse.gmf.runtime.common.ui.services.properties.extended;
12
package org.eclipse.gmf.runtime.common.ui.services.properties.extended;
13
13
14
import org.eclipse.gmf.runtime.common.ui.services.properties.internal.l10n.CommonUiServicesPropertiesMessages;
14
import org.eclipse.ui.views.properties.IPropertyDescriptor;
15
import org.eclipse.ui.views.properties.IPropertyDescriptor;
15
import org.eclipse.ui.views.properties.IPropertySource;
16
import org.eclipse.ui.views.properties.IPropertySource;
16
import org.eclipse.ui.views.properties.PropertyDescriptor;
17
import org.eclipse.ui.views.properties.PropertyDescriptor;
17
18
18
import org.eclipse.gmf.runtime.common.ui.services.properties.internal.l10n.PSFResourceManager;
19
20
/**
19
/**
21
 * @author Tauseef A. Israr Created on: Sep 9, 2002
20
 * @author Tauseef A. Israr Created on: Sep 9, 2002
22
 */
21
 */
Lines 24-33 Link Here
24
	extends PropertyDescriptor
23
	extends PropertyDescriptor
25
	implements IExtendedPropertyDescriptor {
24
	implements IExtendedPropertyDescriptor {
26
25
27
	/** Blank extended property descriptor. */
28
	public static final String BLANK = PSFResourceManager
29
		.getI18NString("ExtendedPropertyDescriptor.blank"); //$NON-NLS-1$
30
31
	private IPropertySource propertySource;
26
	private IPropertySource propertySource;
32
27
33
	private boolean dirty = false;
28
	private boolean dirty = false;
Lines 80-86 Link Here
80
	 * @see org.eclipse.gmf.runtime.common.ui.services.properties.extended.IExtendedPropertyDescriptor#getBlank()
75
	 * @see org.eclipse.gmf.runtime.common.ui.services.properties.extended.IExtendedPropertyDescriptor#getBlank()
81
	 */
76
	 */
82
	public Object getBlank() {
77
	public Object getBlank() {
83
		return BLANK;
78
		return CommonUiServicesPropertiesMessages.ExtendedPropertyDescriptor_blank;
84
	}
79
	}
85
80
86
	/**
81
	/**
(-)src/org/eclipse/gmf/runtime/common/ui/services/properties/extended/ExtendedTextPropertyDescriptor.java (-8 / +2 lines)
Lines 13-18 Link Here
13
13
14
import java.text.MessageFormat;
14
import java.text.MessageFormat;
15
15
16
import org.eclipse.gmf.runtime.common.ui.services.properties.internal.l10n.CommonUiServicesPropertiesMessages;
16
import org.eclipse.jface.dialogs.MessageDialog;
17
import org.eclipse.jface.dialogs.MessageDialog;
17
import org.eclipse.jface.viewers.CellEditor;
18
import org.eclipse.jface.viewers.CellEditor;
18
import org.eclipse.jface.viewers.TextCellEditor;
19
import org.eclipse.jface.viewers.TextCellEditor;
Lines 21-28 Link Here
21
import org.eclipse.swt.widgets.Composite;
22
import org.eclipse.swt.widgets.Composite;
22
import org.eclipse.swt.widgets.Display;
23
import org.eclipse.swt.widgets.Display;
23
24
24
import org.eclipse.gmf.runtime.common.ui.services.properties.internal.l10n.PSFResourceManager;
25
26
/**
25
/**
27
 * @author Tauseef A. Israr
26
 * @author Tauseef A. Israr
28
 * Created on: Sep 9, 2002
27
 * Created on: Sep 9, 2002
Lines 31-41 Link Here
31
	extends ExtendedPropertyDescriptor {
30
	extends ExtendedPropertyDescriptor {
32
31
33
	/**
32
	/**
34
	 * The title of the dialog box.
35
	 */
36
	private static String DIALOG_TITLE = PSFResourceManager.getI18NString("ExtendedTextPropertyDescriptor.PropertiesViewErrorDialog.Title"); //$NON-NLS-1$ 
37
38
	/**
39
	 * Constructor for ExtendedTextPropertyDescriptor.
33
	 * Constructor for ExtendedTextPropertyDescriptor.
40
	 * @param id
34
	 * @param id
41
	 * @param displayName
35
	 * @param displayName
Lines 108-114 Link Here
108
					if (!newValidState) {
102
					if (!newValidState) {
109
						MessageDialog.openError(
103
						MessageDialog.openError(
110
							Display.getCurrent().getActiveShell(),
104
							Display.getCurrent().getActiveShell(),
111
							DIALOG_TITLE,
105
							CommonUiServicesPropertiesMessages.ExtendedTextPropertyDescriptor_PropertiesViewErrorDialog_Title,
112
							getErrorMessage());
106
							getErrorMessage());
113
						fireCancelEditor();
107
						fireCancelEditor();
114
					} else {
108
					} else {
(-)src/org/eclipse/gmf/runtime/common/ui/services/properties/extended/PropertySource.java (-11 / +5 lines)
Lines 20-26 Link Here
20
import org.eclipse.ui.views.properties.IPropertyDescriptor;
20
import org.eclipse.ui.views.properties.IPropertyDescriptor;
21
21
22
import org.eclipse.gmf.runtime.common.ui.services.properties.ICompositePropertySource;
22
import org.eclipse.gmf.runtime.common.ui.services.properties.ICompositePropertySource;
23
import org.eclipse.gmf.runtime.common.ui.services.properties.internal.l10n.PSFResourceManager;
23
import org.eclipse.gmf.runtime.common.ui.services.properties.internal.l10n.CommonUiServicesPropertiesMessages;
24
24
25
/**
25
/**
26
 * @author Tauseef A. Israr Created on: Aug 27, 2002
26
 * @author Tauseef A. Israr Created on: Aug 27, 2002
Lines 29-40 Link Here
29
public class PropertySource implements IExtendedPropertySource {
29
public class PropertySource implements IExtendedPropertySource {
30
30
31
    /**
31
    /**
32
     * externalized error message
33
     */
34
    protected static final String PROPERTY_ID_DESCRIPTOR_ERROR = PSFResourceManager
35
            .getI18NString("PropertySource._ERROR_.descriptorError"); //$NON-NLS-1$
36
37
    /**
38
     * refernce to the model element to whose properties are represented by this
32
     * refernce to the model element to whose properties are represented by this
39
     * propertysource instance
33
     * propertysource instance
40
     */
34
     */
Lines 109-115 Link Here
109
    public Object getEditableValue() {
103
    public Object getEditableValue() {
110
        if (isDirty()) {
104
        if (isDirty()) {
111
            setDirty(false);
105
            setDirty(false);
112
            return ExtendedPropertyDescriptor.BLANK;
106
            return CommonUiServicesPropertiesMessages.ExtendedPropertyDescriptor_blank;
113
        }
107
        }
114
        if (getElement() == null && enclosed != null)
108
        if (getElement() == null && enclosed != null)
115
            return enclosed.getEditableValue();
109
            return enclosed.getEditableValue();
Lines 180-187 Link Here
180
174
181
            Object[] args = new Object[1];
175
            Object[] args = new Object[1];
182
            args[0] = id;
176
            args[0] = id;
183
            String message = MessageFormat.format(PROPERTY_ID_DESCRIPTOR_ERROR,
177
            String message = MessageFormat.format(CommonUiServicesPropertiesMessages.PropertySource__ERROR__descriptorError,
184
                    args);
178
            	args);
185
179
186
            assert null != propertyDescriptor : message;
180
            assert null != propertyDescriptor : message;
187
            if (propertyDescriptor.isDirty()) {
181
            if (propertyDescriptor.isDirty()) {
Lines 369-375 Link Here
369
        if (value == null)
363
        if (value == null)
370
            return true;
364
            return true;
371
        if (value instanceof String) {
365
        if (value instanceof String) {
372
            if (((String) value).equals(ExtendedPropertyDescriptor.BLANK))
366
            if (((String) value).equals(CommonUiServicesPropertiesMessages.ExtendedPropertyDescriptor_blank))
373
                return false;
367
                return false;
374
        }
368
        }
375
        return true;
369
        return true;
(-)src/org/eclipse/gmf/runtime/common/ui/services/properties/internal/PSFCommonUIPlugin.java (-13 lines)
Lines 11-19 Link Here
11
11
12
package org.eclipse.gmf.runtime.common.ui.services.properties.internal;
12
package org.eclipse.gmf.runtime.common.ui.services.properties.internal;
13
13
14
import org.eclipse.gmf.runtime.common.core.l10n.AbstractResourceManager;
15
import org.eclipse.gmf.runtime.common.ui.plugin.XToolsUIPlugin;
14
import org.eclipse.gmf.runtime.common.ui.plugin.XToolsUIPlugin;
16
import org.eclipse.gmf.runtime.common.ui.services.properties.internal.l10n.PSFResourceManager;
17
15
18
/**
16
/**
19
 * The main plugin class to be used in the desktop.
17
 * The main plugin class to be used in the desktop.
Lines 50-64 Link Here
50
	public static String getPluginId() {
48
	public static String getPluginId() {
51
		return getDefault().getSymbolicName();
49
		return getDefault().getSymbolicName();
52
	}
50
	}
53
54
	/**
55
	 * Retrieves the resource manager for this plug-in.
56
	 * 
57
	 * @return The resource manager for this plug-in.
58
	 * 
59
	 * @see org.eclipse.gmf.runtime.common.ui.plugin.XToolsUIPlugin#getResourceManager()
60
	 */
61
	public AbstractResourceManager getResourceManager() {
62
		return PSFResourceManager.getInstance();
63
	}
64
}
51
}
(-)src/org/eclipse/gmf/runtime/common/ui/services/properties/internal/l10n/PSFResourceManager.java (-79 lines)
Removed Link Here
1
/******************************************************************************
2
 * Copyright (c) 2005 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *    IBM Corporation - initial API and implementation 
10
 ****************************************************************************/
11
/*
12
 * Created on Apr 28, 2004
13
 *
14
 * TODO To change the template for this generated file go to
15
 * Window - Preferences - Java - Code Generation - Code and Comments
16
 */
17
package org.eclipse.gmf.runtime.common.ui.services.properties.internal.l10n;
18
19
import org.eclipse.core.runtime.Plugin;
20
21
import org.eclipse.gmf.runtime.common.core.l10n.AbstractResourceManager;
22
import org.eclipse.gmf.runtime.common.ui.services.properties.internal.PSFCommonUIPlugin;
23
24
25
/**
26
 * Common UI Properties Service Framework Resource manager object
27
 * 
28
 * @author nbalaba
29
 */
30
public final class PSFResourceManager
31
	extends AbstractResourceManager {
32
33
	/**
34
	 * Singleton instance of the resource manager.
35
	 */
36
	private static PSFResourceManager instance = new PSFResourceManager();
37
38
	/**
39
	 * Initializes me.
40
	 */
41
	private PSFResourceManager() {
42
		super();
43
	}
44
45
	/**
46
	 * Retrieves the singleton instance of this resource manager.
47
	 * 
48
	 * @return The singleton resource manager.
49
	 */
50
	public static PSFResourceManager getInstance() {
51
		return instance;
52
	}
53
	
54
	/**
55
	 * Retrieves internationalized string.
56
	 * 
57
	 * @param key string key
58
	 * @return internationalized string
59
	 */
60
	public static String getI18NString(String key){
61
	    return getInstance().getString(key);
62
	
63
	}
64
65
	// implements the inherited method
66
	protected void initializeResources() {
67
	    initializeMessageResources();
68
	}
69
	
70
	/**
71
	 * Convenience method to obtain my plug-in instance.
72
	 *  
73
	 * @return my plug-in
74
	 */
75
	protected Plugin getPlugin() {
76
		return PSFCommonUIPlugin.getDefault();
77
	}
78
79
}
(-)src/org/eclipse/gmf/runtime/common/ui/services/properties/internal/l10n/messages.properties (-51 lines)
Removed Link Here
1
# ==============================================================================
2
#*+------------------------------------------------------------------------+
3
#*| Copyright (c) 2005  IBM Corporation and others.                        |
4
#*| All rights reserved. This program and the accompanying materials       |
5
#*| are made available under the terms of the Eclipse Public License v1.0  |
6
#*| which accompanies this distribution, and is available at               |
7
#*| http://www.eclipse.org/legal/epl-v10.html                              |
8
#*|                                                                        |
9
#*| Contributors:                                                          |
10
#*|    IBM Corporation - initial API and implementation                    |
11
#*+------------------------------------------------------------------------+
12
# ==============================================================================
13
14
15
# Properties View values
16
# RGB is short for Red, Green, Blue and {0},{1},{2} contains the red, green, and blue values respectively.
17
ExtendedColorPropertyLabelProvider.RGBValue = RGB ({0},{1},{2})
18
19
# Properties View values
20
# Properties View boolean values
21
ExtendedBooleanPropertyDescriptor.True = True
22
ExtendedBooleanPropertyDescriptor.False = False
23
24
# the blank value for a cell
25
ExtendedPropertyDescriptor.blank=<multiple unequal values>
26
27
# properties view error dialog title
28
ExtendedTextPropertyDescriptor.PropertiesViewErrorDialog.Title=Properties Error
29
30
# Error getting the property descriptor
31
# {0} = Property ID
32
PropertySource._ERROR_.descriptorError= IRJA0287E Error. The property of given id {0} exists without a descriptor
33
34
35
# Properties View error messages
36
CellValidatorFactory.InvalidIntegerFormat = Invalid integer format.
37
CellValidatorFactory.InvalidPositiveZeroInclusiveIntegerFormat = Invalid integer format. Value must be greater than or equal to 0.
38
CellValidatorFactory.InvalidPositiveZeroExclusiveIntegerFormat = Invalid integer format. Value must be greater than or equal to 1.
39
CellValidatorFactory.InvalidNegativeZeroInclusiveIntegerFormat = Invalid integer format. Value must be less than or equal to 0.
40
CellValidatorFactory.InvalidNegativeZeroExclusiveIntegerFormat = Invalid integer format. Value must be less than or equal to -1.
41
CellValidatorFactory.InvalidRealFormat=Invalid real format.
42
CellValidatorFactory.InvalidByteFormat=Invalid byte format.
43
CellValidatorFactory.InvalidFloatFormat=Invalid float format.
44
CellValidatorFactory.InvalidLongFormat=Invalid long format.
45
CellValidatorFactory.InvalidShortFormat=Invalid short format.
46
CellValidatorFactory.InvalidCharFormat=Invalid char format.
47
48
# properties dialog title
49
PropertyPageCellEditor.PropertiesDialog.title=Properties
50
51
(-)src/org/eclipse/gmf/runtime/common/ui/services/properties/internal/l10n/CommonUiServicesPropertiesMessages.java (+45 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2005 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.gmf.runtime.common.ui.services.properties.internal.l10n;
12
13
import org.eclipse.osgi.util.NLS;
14
15
public final class CommonUiServicesPropertiesMessages extends NLS {
16
17
	private static final String BUNDLE_NAME = "org.eclipse.gmf.runtime.common.ui.services.properties.internal.l10n.CommonUiServicesPropertiesMessages";//$NON-NLS-1$
18
19
	private CommonUiServicesPropertiesMessages() {
20
		// Do not instantiate
21
	}
22
23
	public static String ExtendedColorPropertyLabelProvider_RGBValue;
24
	public static String ExtendedBooleanPropertyDescriptor_True;
25
	public static String ExtendedBooleanPropertyDescriptor_False;
26
	public static String ExtendedPropertyDescriptor_blank;
27
	public static String ExtendedTextPropertyDescriptor_PropertiesViewErrorDialog_Title;
28
	public static String PropertySource__ERROR__descriptorError;
29
	public static String CellValidatorFactory_InvalidIntegerFormat;
30
	public static String CellValidatorFactory_InvalidPositiveZeroInclusiveIntegerFormat;
31
	public static String CellValidatorFactory_InvalidPositiveZeroExclusiveIntegerFormat;
32
	public static String CellValidatorFactory_InvalidNegativeZeroInclusiveIntegerFormat;
33
	public static String CellValidatorFactory_InvalidNegativeZeroExclusiveIntegerFormat;
34
	public static String CellValidatorFactory_InvalidRealFormat;
35
	public static String CellValidatorFactory_InvalidByteFormat;
36
	public static String CellValidatorFactory_InvalidFloatFormat;
37
	public static String CellValidatorFactory_InvalidLongFormat;
38
	public static String CellValidatorFactory_InvalidShortFormat;
39
	public static String CellValidatorFactory_InvalidCharFormat;
40
	public static String PropertyPageCellEditor_PropertiesDialog_title;
41
42
	static {
43
		NLS.initializeMessages(BUNDLE_NAME, CommonUiServicesPropertiesMessages.class);
44
	}
45
}
(-)src/org/eclipse/gmf/runtime/common/ui/services/properties/internal/l10n/CommonUiServicesPropertiesMessages.properties (+51 lines)
Added Link Here
1
# ==============================================================================
2
#*+------------------------------------------------------------------------+
3
#*| Copyright (c) 2005  IBM Corporation and others.                        |
4
#*| All rights reserved. This program and the accompanying materials       |
5
#*| are made available under the terms of the Eclipse Public License v1.0  |
6
#*| which accompanies this distribution, and is available at               |
7
#*| http://www.eclipse.org/legal/epl-v10.html                              |
8
#*|                                                                        |
9
#*| Contributors:                                                          |
10
#*|    IBM Corporation - initial API and implementation                    |
11
#*+------------------------------------------------------------------------+
12
# ==============================================================================
13
14
15
# Properties View values
16
# RGB is short for Red, Green, Blue and {0},{1},{2} contains the red, green, and blue values respectively.
17
ExtendedColorPropertyLabelProvider_RGBValue = RGB ({0},{1},{2})
18
19
# Properties View values
20
# Properties View boolean values
21
ExtendedBooleanPropertyDescriptor_True = True
22
ExtendedBooleanPropertyDescriptor_False = False
23
24
# the blank value for a cell
25
ExtendedPropertyDescriptor_blank=<multiple unequal values>
26
27
# properties view error dialog title
28
ExtendedTextPropertyDescriptor_PropertiesViewErrorDialog_Title=Properties Error
29
30
# Error getting the property descriptor
31
# {0} = Property ID
32
PropertySource__ERROR__descriptorError= IRJA0287E Error. The property of given id {0} exists without a descriptor
33
34
35
# Properties View error messages
36
CellValidatorFactory_InvalidIntegerFormat = Invalid integer format.
37
CellValidatorFactory_InvalidPositiveZeroInclusiveIntegerFormat = Invalid integer format. Value must be greater than or equal to 0.
38
CellValidatorFactory_InvalidPositiveZeroExclusiveIntegerFormat = Invalid integer format. Value must be greater than or equal to 1.
39
CellValidatorFactory_InvalidNegativeZeroInclusiveIntegerFormat = Invalid integer format. Value must be less than or equal to 0.
40
CellValidatorFactory_InvalidNegativeZeroExclusiveIntegerFormat = Invalid integer format. Value must be less than or equal to -1.
41
CellValidatorFactory_InvalidRealFormat=Invalid real format.
42
CellValidatorFactory_InvalidByteFormat=Invalid byte format.
43
CellValidatorFactory_InvalidFloatFormat=Invalid float format.
44
CellValidatorFactory_InvalidLongFormat=Invalid long format.
45
CellValidatorFactory_InvalidShortFormat=Invalid short format.
46
CellValidatorFactory_InvalidCharFormat=Invalid char format.
47
48
# properties dialog title
49
PropertyPageCellEditor_PropertiesDialog_title=Properties
50
51

Return to bug 109445