Methods Summary |
---|
public boolean | checkAndSet(java.lang.String value, FolderConfiguration config)
Matcher m = sDimensionPattern.matcher(value);
if (m.matches()) {
String d1 = m.group(1);
String d2 = m.group(2);
ScreenDimensionQualifier qualifier = getQualifier(d1, d2);
if (qualifier != null) {
config.setScreenDimensionQualifier(qualifier);
return true;
}
}
return false;
|
public boolean | equals(java.lang.Object qualifier)
if (qualifier instanceof ScreenDimensionQualifier) {
ScreenDimensionQualifier q = (ScreenDimensionQualifier)qualifier;
return (mValue1 == q.mValue1 && mValue2 == q.mValue2);
}
return false;
|
public org.eclipse.swt.graphics.Image | getIcon()
return IconFactory.getInstance().getIcon("dimension"); //$NON-NLS-1$
|
public java.lang.String | getName()
return NAME;
|
public static com.android.ide.eclipse.editors.resources.configurations.ScreenDimensionQualifier | getQualifier(java.lang.String size1, java.lang.String size2)
try {
int s1 = Integer.parseInt(size1);
int s2 = Integer.parseInt(size2);
ScreenDimensionQualifier qualifier = new ScreenDimensionQualifier();
if (s1 > s2) {
qualifier.mValue1 = s1;
qualifier.mValue2 = s2;
} else {
qualifier.mValue1 = s2;
qualifier.mValue2 = s1;
}
return qualifier;
} catch (NumberFormatException e) {
// looks like the string we extracted wasn't a valid number.
}
return null;
|
public java.lang.String | getShortName()
return "Dimension";
|
public java.lang.String | getStringValue()
if (mValue1 != -1 && mValue2 != -1) {
return String.format("%1$dx%2$d", mValue1, mValue2);
}
return ""; //$NON-NLS-1$
|
public int | getValue1()
return mValue1;
|
public int | getValue2()
return mValue2;
|
public int | hashCode()
return toString().hashCode();
|
public boolean | isValid()
return mValue1 != DEFAULT_SIZE && mValue2 != DEFAULT_SIZE;
|
public java.lang.String | toString()Returns the string used to represent this qualifier in the folder name.
return String.format("%1$dx%2$d", mValue1, mValue2); //$NON-NLS-1$
|