Author: adietish
Date: 2012-02-24 04:07:13 -0500 (Fri, 24 Feb 2012)
New Revision: 39092
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/property/UserPropertySource.java
Log:
cleanup: extracted constants
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/property/UserPropertySource.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/property/UserPropertySource.java 2012-02-24
08:45:34 UTC (rev 39091)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/property/UserPropertySource.java 2012-02-24
09:07:13 UTC (rev 39092)
@@ -23,6 +23,8 @@
*/
public class UserPropertySource implements IPropertySource {
+ private static final String PROPERTY_DOMAIN = "Domain";
+ private static final String PROPERTY_USERNAME = "Username";
private final IUser user;
public UserPropertySource(IUser user) {
@@ -36,17 +38,18 @@
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
- return new IPropertyDescriptor[] { new PropertyDescriptor("Username",
"Username"),
- new PropertyDescriptor("Domain", "Domain") };
+ return new IPropertyDescriptor[] {
+ new PropertyDescriptor(PROPERTY_USERNAME, PROPERTY_USERNAME),
+ new PropertyDescriptor(PROPERTY_DOMAIN, PROPERTY_DOMAIN) };
}
@Override
public Object getPropertyValue(Object id) {
try {
- if (id.equals("Username")) {
+ if (id.equals(PROPERTY_USERNAME)) {
return user.getRhlogin();
}
- if (id.equals("Domain") && user.hasDomain()) {
+ if (id.equals(PROPERTY_DOMAIN) && user.hasDomain()) {
return user.getDomain().getNamespace() + "." +
user.getDomain().getRhcDomain();
}
} catch (OpenShiftException e) {
Show replies by date