Search in sources :

Example 1 with RenderComponentAction

use of com.servoy.j2db.server.headlessclient.PageJSActionBuffer.RenderComponentAction in project servoy-client by Servoy.

the class MainPage method setTitle.

public void setTitle(String name) {
    touch();
    Solution solution = this.client.getSolution();
    // $NON-NLS-1$
    String titleString = "";
    String solutionTitle = solution.getTitleText();
    if (solutionTitle == null) {
        titleString = solution.getName();
    } else if (// $NON-NLS-1$
    !solutionTitle.equals("<empty>")) {
        titleString = solutionTitle;
    }
    titleString = client.getI18NMessageIfPrefixed(titleString);
    if (// $NON-NLS-1$ //$NON-NLS-2$
    name != null && !name.trim().equals("") && !"<empty>".equals(name) && main != null) {
        String nameString = client.getI18NMessageIfPrefixed(name);
        FormController formController = main.getController();
        if (formController != null) {
            String name2 = Text.processTags(nameString, formController.getTagResolver());
            if (name2 != null)
                nameString = name2;
        } else {
            String name2 = Text.processTags(nameString, TagResolver.createResolver(new PrototypeState(null)));
            if (name2 != null)
                nameString = name2;
        }
        if (// $NON-NLS-1$
        !nameString.trim().equals("")) {
            if (// $NON-NLS-1$
            "".equals(titleString)) {
                titleString += nameString;
            } else {
                // $NON-NLS-1$
                titleString += " - " + nameString;
            }
        }
    }
    // $NON-NLS-1$
    String appName = "Servoy Web Client";
    // $NON-NLS-1$ //$NON-NLS-2$
    boolean branding = Utils.getAsBoolean(client.getSettings().getProperty("servoy.branding", "false"));
    // $NON-NLS-1$
    String appTitle = client.getSettings().getProperty("servoy.branding.windowtitle");
    if (branding && appTitle != null) {
        appName = appTitle;
    }
    if (// $NON-NLS-1$
    titleString.equals("")) {
        titleString = appName;
    } else {
        // $NON-NLS-1$
        titleString += " - " + appName;
    }
    this.title.setDefaultModelObject(titleString);
    addJSAction(new RenderComponentAction(title));
}
Also used : IFormController(com.servoy.j2db.IFormController) FormController(com.servoy.j2db.FormController) RenderComponentAction(com.servoy.j2db.server.headlessclient.PageJSActionBuffer.RenderComponentAction) PrototypeState(com.servoy.j2db.dataprocessing.PrototypeState) Solution(com.servoy.j2db.persistence.Solution)

Aggregations

FormController (com.servoy.j2db.FormController)1 IFormController (com.servoy.j2db.IFormController)1 PrototypeState (com.servoy.j2db.dataprocessing.PrototypeState)1 Solution (com.servoy.j2db.persistence.Solution)1 RenderComponentAction (com.servoy.j2db.server.headlessclient.PageJSActionBuffer.RenderComponentAction)1