/**
* @author Berthold Daum
- *
+ *
*/
public class PropertyStore extends PreferenceStore {
private IResource resource;
+
private IPreferenceStore workbenchStore;
+
private String pageId;
+
private boolean inserting = false;
- public PropertyStore(
- IResource resource,
- IPreferenceStore workbenchStore,
- String pageId) {
+ public PropertyStore(IResource resource, IPreferenceStore workbenchStore,
+ String pageId) {
this.resource = resource;
this.workbenchStore = workbenchStore;
this.pageId = pageId;
}
- /*** Write modified values back to properties ***/
+ /** * Write modified values back to properties ** */
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jface.preference.IPersistentPreferenceStore#save()
*/
public void save() throws IOException {
writeProperties();
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferenceStore#save(java.io.OutputStream, java.lang.String)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.preference.PreferenceStore#save(java.io.OutputStream,
+ * java.lang.String)
*/
public void save(OutputStream out, String header) throws IOException {
writeProperties();
try {
setProperty(name, getString(name));
} catch (CoreException e) {
- throw new IOException(Messages.getString("PropertyStore.Cannot_write_resource_property") + name); //$NON-NLS-1$
+ throw new IOException(
+ Messages
+ .getString("PropertyStore.Cannot_write_resource_property") + name); //$NON-NLS-1$
}
}
}
/**
* Convenience method to set a property
- * @param name - the preference name
- * @param value - the property value or null to delete the property
+ *
+ * @param name -
+ * the preference name
+ * @param value -
+ * the property value or null to delete the property
* @throws CoreException
*/
private void setProperty(String name, String value) throws CoreException {
resource.setPersistentProperty(new QualifiedName(pageId, name), value);
}
- /*** Get default values (Delegate to workbench store) ***/
+ /** * Get default values (Delegate to workbench store) ** */
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jface.preference.IPreferenceStore#getDefaultBoolean(java.lang.String)
*/
public boolean getDefaultBoolean(String name) {
return workbenchStore.getDefaultBoolean(name);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jface.preference.IPreferenceStore#getDefaultDouble(java.lang.String)
*/
public double getDefaultDouble(String name) {
return workbenchStore.getDefaultDouble(name);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jface.preference.IPreferenceStore#getDefaultFloat(java.lang.String)
*/
public float getDefaultFloat(String name) {
return workbenchStore.getDefaultFloat(name);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jface.preference.IPreferenceStore#getDefaultInt(java.lang.String)
*/
public int getDefaultInt(String name) {
return workbenchStore.getDefaultInt(name);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jface.preference.IPreferenceStore#getDefaultLong(java.lang.String)
*/
public long getDefaultLong(String name) {
return workbenchStore.getDefaultLong(name);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jface.preference.IPreferenceStore#getDefaultString(java.lang.String)
*/
public String getDefaultString(String name) {
return workbenchStore.getDefaultString(name);
}
- /*** Get property values ***/
+ /** * Get property values ** */
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jface.preference.IPreferenceStore#getBoolean(java.lang.String)
*/
public boolean getBoolean(String name) {
return super.getBoolean(name);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jface.preference.IPreferenceStore#getDouble(java.lang.String)
*/
public double getDouble(String name) {
return super.getDouble(name);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jface.preference.IPreferenceStore#getFloat(java.lang.String)
*/
public float getFloat(String name) {
return super.getFloat(name);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jface.preference.IPreferenceStore#getInt(java.lang.String)
*/
public int getInt(String name) {
return super.getInt(name);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jface.preference.IPreferenceStore#getLong(java.lang.String)
*/
public long getLong(String name) {
return super.getLong(name);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jface.preference.IPreferenceStore#getString(java.lang.String)
*/
public String getString(String name) {
/**
* Convenience method to fetch a property
- * @param name - the preference name
+ *
+ * @param name -
+ * the preference name
* @return - the property value
* @throws CoreException
*/
return resource.getPersistentProperty(new QualifiedName(pageId, name));
}
- /*** Misc ***/
+ /** * Misc ** */
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jface.preference.IPreferenceStore#contains(java.lang.String)
*/
public boolean contains(String name) {
return workbenchStore.contains(name);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jface.preference.IPreferenceStore#setToDefault(java.lang.String)
*/
public void setToDefault(String name) {
- setValue(name, getDefaultString(name));
+ setValue(name, getDefaultString(name));
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jface.preference.IPreferenceStore#isDefault(java.lang.String)
*/
public boolean isDefault(String name) {
String defaultValue = getDefaultString(name);
- if (defaultValue == null) return false;
+ if (defaultValue == null)
+ return false;
return defaultValue.equals(getString(name));
}