import org.eclipse.wb.swt.SWTResourceManager; //導入方法依賴的package包/類
/**
* �������ļ���ԭ������ʽ��text
*
* @param p����������ʽ�������ļ�
* @param text
* ҪӦ��������ʽ��StyledText���
*/
public void getStylesFromProperties(Properties p, StyledText text) {
String start, length, font, fontstyle, strikeout, underline, fontheight;
for (int i = 0; i > -1; i++) {
start = p.getProperty(i + "start");
if (start != null) {
length = p.getProperty(i + "length");
font = p.getProperty(i + "font");
fontheight = p.getProperty(i + "fontheight");
fontstyle = p.getProperty(i + "fontstyle");
strikeout = p.getProperty(i + "strikeout");
underline = p.getProperty(i + "underline");
if (Integer.valueOf(fontheight) >= 0) {
Font f = SWTResourceManager.getFont(font, b.getZoomedFontSize(Integer.valueOf(fontheight)),
Integer.valueOf(fontstyle));
TextStyle ts = new TextStyle(f, null, null);
ts.strikeout = Boolean.valueOf(strikeout);
ts.underline = Boolean.valueOf(underline);
StyleRange sr = new StyleRange(ts);
sr.start = Integer.valueOf(start);
sr.length = Integer.valueOf(length);
if (sr.start >= 0 && sr.length + sr.start <= text.getCharCount())
text.setStyleRange(sr);
} else
getMessageBox("��ȡ�ļ�ʱ����", "black�ļ��е���ʽ��������������߶Ȳ���Ϊ��ֵ��");
} else
break;
}
for (int a = 0; a > -1; ++a) {
String startline = p.getProperty(a + "alignmentstartline");
if (startline != null) {
text.setLineAlignment(Integer.valueOf(startline), 1, Integer.valueOf(p.getProperty(a + "alignment")));
} else
break;
}
}