Examples of NlsSupport


Examples of org.eclipse.wb.internal.core.nls.NlsSupport

            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "    rootPanel.setTitle(CONSTANTS.rootPanel_title());",
            "  }",
            "}");
    NlsSupport support = NlsSupport.get(frame);
    IEditableSupport editableSupport = support.getEditable();
    IEditableSource editableSource = editableSupport.getEditableSources().get(0);
    // do rename
    editableSource.renameKey("rootPanel_title", "rootPanel_title2");
    // apply commands
    support.applyEditable(editableSupport);
    // check
    assertEditor(
        "public class Test implements EntryPoint {",
        "  private static final MyConstants CONSTANTS = GWT.create(MyConstants.class);",
        "  public void onModuleLoad() {",
View Full Code Here

Examples of org.eclipse.wb.internal.core.nls.NlsSupport

            "}");
    frame.refresh();
    GenericProperty property = (GenericProperty) frame.getPropertyByTitle("title");
    // set key
    {
      NlsSupport support = NlsSupport.get(frame);
      AbstractSource source = support.getSources()[0];
      source.useKey(property, "rootPanel.title");
    }
    assertEditor(
        "public class Test implements EntryPoint {",
        "  private static final MyConstants CONSTANTS = GWT.create(MyConstants.class);",
View Full Code Here

Examples of org.eclipse.wb.internal.core.nls.NlsSupport

            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "    rootPanel.setTitle(CONSTANTS.rootPanel_title());",
            "  }",
            "}");
    NlsSupport support = NlsSupport.get(frame);
    IEditableSupport editableSupport = support.getEditable();
    IEditableSource editableSource = editableSupport.getEditableSources().get(0);
    // do internalize
    editableSource.internalizeKey("rootPanel_title");
    // apply commands
    support.applyEditable(editableSupport);
    // check
    assertEditor(
        "public class Test implements EntryPoint {",
        "  private static final MyConstants CONSTANTS = GWT.create(MyConstants.class);",
        "  public void onModuleLoad() {",
View Full Code Here

Examples of org.eclipse.wb.internal.core.nls.NlsSupport

            "  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() {",
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.