Methods Summary |
---|
public boolean | checkAndSet(java.lang.String value, FolderConfiguration config)
PixelDensityQualifier qualifier = getQualifier(value);
if (qualifier != null) {
config.setPixelDensityQualifier(qualifier);
return true;
}
return false;
|
public boolean | equals(java.lang.Object qualifier)
if (qualifier instanceof PixelDensityQualifier) {
return mValue == ((PixelDensityQualifier)qualifier).mValue;
}
return false;
|
public static java.lang.String | getFolderSegment(int value)Returns the folder name segment for the given value. This is equivalent to calling
{@link #toString()} on a {@link NetworkCodeQualifier} object.
if (value != DEFAULT_DENSITY) {
return String.format("%1$ddpi", value); //$NON-NLS-1$
}
return ""; //$NON-NLS-1$
|
public org.eclipse.swt.graphics.Image | getIcon()
return IconFactory.getInstance().getIcon("dpi"); //$NON-NLS-1$
|
public java.lang.String | getName()
return NAME;
|
public static com.android.ide.eclipse.editors.resources.configurations.PixelDensityQualifier | getQualifier(java.lang.String folderSegment)Creates and returns a qualifier from the given folder segment. If the segment is incorrect,
null is returned.
Matcher m = sPixelDensityPattern.matcher(folderSegment);
if (m.matches()) {
String v = m.group(1);
int density = -1;
try {
density = Integer.parseInt(v);
} catch (NumberFormatException e) {
// looks like the string we extracted wasn't a valid number.
return null;
}
PixelDensityQualifier qualifier = new PixelDensityQualifier();
qualifier.mValue = density;
return qualifier;
}
return null;
|
public java.lang.String | getShortName()
return NAME;
|
public java.lang.String | getStringValue()
if (mValue != DEFAULT_DENSITY) {
return String.format("%1$d dpi", mValue);
}
return ""; //$NON-NLS-1$
|
public int | getValue()
return mValue;
|
public int | hashCode()
return mValue;
|
public boolean | isValid()
return mValue != DEFAULT_DENSITY;
|
public java.lang.String | toString()Returns the string used to represent this qualifier in the folder name.
return getFolderSegment(mValue);
|