Subversion Repository Public Repository

litesoft

Diff Revisions 949 vs 950 for /trunk/Java/GWT/OldClient/src/org/litesoft/GWT/client/widgets/SimpleFloatingPanel.java

Diff revisions: vs.
  @@ -1,51 +1,51 @@
1 - // This Source Code is in the Public Domain per: http://unlicense.org
2 - package org.litesoft.GWT.client.widgets;
3 -
4 - import org.litesoft.GWT.client.widgets.nonpublic.*;
5 -
6 - import com.google.gwt.user.client.ui.*;
7 -
8 - public class SimpleFloatingPanel extends SizeableFloatingPanel {
9 - public SimpleFloatingPanel() {
10 - }
11 -
12 - public SimpleFloatingPanel( Widget pWidget ) {
13 - setWidget( pWidget );
14 - }
15 -
16 - public SimpleFloatingPanel setTitleBar( SizeableFloatableContainerPanel pContainerPanel, String pTitle ) {
17 - setTitleBar( createTitleBar( pTitle, this, pContainerPanel ) );
18 - return this;
19 - }
20 -
21 - protected FloaterTitleBar createTitleBar( String pTitle, final SimpleFloatingPanel pFloater,
22 - final SizeableFloatableContainerPanel pContainerPanel ) {
23 - return new CloseableFloaterPanelTitleBar( "Floater", pTitle, null );
24 - // todo: translate: new ClickListener()
25 - // {
26 - // public void onClick( Widget sender )
27 - // {
28 - // pContainerPanel.remove( pFloater );
29 - // }
30 - // } );
31 - }
32 -
33 - public void setVisible( boolean visible ) {
34 - super.setVisible( visible );
35 - chkMaximize();
36 - }
37 -
38 - protected void onAttach() {
39 - super.onAttach();
40 - chkMaximize();
41 - }
42 -
43 - private boolean mMaximized = false;
44 -
45 - private void chkMaximize() {
46 - if ( isAttached() && isVisible() && !mMaximized ) {
47 - mMaximized = true;
48 - maximizeVisibility();
49 - }
50 - }
51 - }
1 + // This Source Code is in the Public Domain per: http://unlicense.org
2 + package org.litesoft.GWT.client.widgets;
3 +
4 + import org.litesoft.GWT.client.widgets.nonpublic.*;
5 +
6 + import com.google.gwt.user.client.ui.*;
7 +
8 + public class SimpleFloatingPanel extends SizeableFloatingPanel {
9 + public SimpleFloatingPanel() {
10 + }
11 +
12 + public SimpleFloatingPanel( Widget pWidget ) {
13 + setWidget( pWidget );
14 + }
15 +
16 + public SimpleFloatingPanel setTitleBar( SizeableFloatableContainerPanel pContainerPanel, String pTitle ) {
17 + setTitleBar( createTitleBar( pTitle, this, pContainerPanel ) );
18 + return this;
19 + }
20 +
21 + protected FloaterTitleBar createTitleBar( String pTitle, final SimpleFloatingPanel pFloater,
22 + final SizeableFloatableContainerPanel pContainerPanel ) {
23 + return new CloseableFloaterPanelTitleBar( "Floater", pTitle, null );
24 + // todo: translate: new ClickListener()
25 + // {
26 + // public void onClick( Widget sender )
27 + // {
28 + // pContainerPanel.remove( pFloater );
29 + // }
30 + // } );
31 + }
32 +
33 + public void setVisible( boolean visible ) {
34 + super.setVisible( visible );
35 + chkMaximize();
36 + }
37 +
38 + protected void onAttach() {
39 + super.onAttach();
40 + chkMaximize();
41 + }
42 +
43 + private boolean mMaximized = false;
44 +
45 + private void chkMaximize() {
46 + if ( isAttached() && isVisible() && !mMaximized ) {
47 + mMaximized = true;
48 + maximizeVisibility();
49 + }
50 + }
51 + }