Subversion Repository Public Repository

litesoft

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package com.temp.client.foundation.widget;

import com.temp.client.foundation.pavment.View;
import com.temp.client.foundation.util.UtilsGwt;
import com.temp.client.foundation.widget.dialog.AlertDialog;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;

/**
 * This class provides a home for common behavior across all our "page-like"
 * Views.
 *
 * @author georgs
 */
public abstract class ViewComposite extends Composite implements View {

    /**
     * When the Widget is injected, set the "ID" of the Widget to a simplified
     * class Name.
     *
     * Simplified class Name is one that:
     * <ol>
     * <li>Ignores Inner Classes (removes '$' and anything after)</li>
     * <li>Removes the "package" (everything thru the last '.')</li>
     * <li>Removes "Impl" from the end if there</li>
     * </ol>
     * e.g.
     * "com.temp.client.module.dashboard.dash.DashViewImpl$1" ->
     * "DashView"
     */
    @Override
    protected void initWidget(Widget widget) {
        super.initWidget(widget);
        UtilsGwt.setIdToClassNameOf(widget, this);
    }

    public void showLibraryAccountNotFoundError() {
        alert("No Library Account Name", "Please file a Contact Us Report");
    }

    protected void alert(String title, String... bodyTextBlocksAboveCloseButton) {
        createAlert(title, bodyTextBlocksAboveCloseButton).show();
    }

    protected AlertDialog createAlert(String title, String... bodyTextBlocksAboveCloseButton) {
        return new AlertDialog(title, bodyTextBlocksAboveCloseButton).centerContent();
    }
}

Commits for litesoft/trunk/GWT_Sandbox/FormEngine/src/com/temp/client/foundation/widget/ViewComposite.java

Diff revisions: vs.
Revision Author Commited Message
626 GeorgeS picture GeorgeS Wed 11 Apr, 2012 19:39:41 +0000