" public void onModuleLoad() {",
" RootPanel rootPanel = RootPanel.get();",
" rootPanel.setTitle('My title');",
" }",
"}");
NlsSupport support = NlsSupport.get(frame);
IEditableSupport editableSupport = support.getEditable();
// prepare editable source
IEditableSource editableSource = NlsTestUtils.createEmptyEditable("test.client.MyConstants");
editableSource.setKeyGeneratorStrategy(GwtSource.GWT_KEY_GENERATOR);
// prepare parameters
SourceParameters parameters = new SourceParameters();
IJavaProject javaProject = m_lastEditor.getJavaProject();
{
parameters.m_constant = new SourceClassParameters();
SourceClassParameters constant = parameters.m_constant;
constant.m_sourceFolder = javaProject.findPackageFragmentRoot(new Path("/TestProject/src"));
constant.m_package =
javaProject.findPackageFragment(new Path("/TestProject/src/test/client"));
constant.m_packageFolder = (IFolder) constant.m_package.getUnderlyingResource();
constant.m_packageName = constant.m_package.getElementName();
constant.m_className = "MyConstants";
constant.m_fullClassName = "test.client.MyConstants";
constant.m_exists = false;
}
parameters.m_fieldName = "CONSTANTS";
// add source
{
SourceDescription sourceDescription =
new SourceDescription(GwtSource.class, GwtSourceNewComposite.class);
editableSupport.addSource(editableSource, sourceDescription, parameters);
}
// do externalize
StringPropertyInfo propertyInfo = editableSupport.getProperties(frame).get(0);
editableSupport.externalizeProperty(propertyInfo, editableSource, true);
// apply commands
support.applyEditable(editableSupport);
// checks
assertEditor(
"public class Test implements EntryPoint {",
" private static final MyConstants CONSTANTS = GWT.create(MyConstants.class);",
" public void onModuleLoad() {",