|
@@ -1,49 +1,49 @@ |
1 |
|
- |
// This Source Code is in the Public Domain per: http://unlicense.org |
2 |
|
- |
package org.litesoft.GWT.client.widgets.nonpublic; |
3 |
|
- |
|
4 |
|
- |
import org.litesoft.GWT.client.iconservice.*; |
5 |
|
- |
import org.litesoft.GWT.client.widgets.*; |
6 |
|
- |
|
7 |
|
- |
import com.google.gwt.user.client.ui.*; |
8 |
|
- |
|
9 |
|
- |
public class CloseableIconFloaterPanelTitleBar extends FloaterTitleBar { |
10 |
|
- |
protected SimpleLabel mTitle = new SimpleLabel( "" ); |
11 |
|
- |
private String mFactoryRef; |
12 |
|
- |
|
13 |
|
- |
public CloseableIconFloaterPanelTitleBar( String pForm, String pFactoryRef, String pTitle, |
14 |
|
- |
ClickListener pCloseClickListener ) { |
15 |
|
- |
mTitle.setStyleName( "litesoft-" + pForm + "BarCaption" ); |
16 |
|
- |
setVerticalAlignment( ALIGN_MIDDLE ); |
17 |
|
- |
setTitleBarTitle( pTitle ); |
18 |
|
- |
setFactoryRef( pFactoryRef ); |
19 |
|
- |
buildTitleBar( pCloseClickListener ); |
20 |
|
- |
} |
21 |
|
- |
|
22 |
|
- |
protected void buildTitleBar( ClickListener pCloseClickListener ) { |
23 |
|
- |
IconService.DefinitionPlus definition = IconServiceLocator.get().getDefinition( getFactoryRef(), // |
24 |
|
- |
getTitleBarTitle() ); |
25 |
|
- |
add( new Image( definition.getDefinition().getSmallIconURL() ) ); |
26 |
|
- |
add( new Spacer().width( 5 ) ); |
27 |
|
- |
add( mTitle ); |
28 |
|
- |
add( new Spacer().width( 5 ) ); |
29 |
|
- |
add( new SizeableSpacer().stretchableHorizontally() ); |
30 |
|
- |
// todo: translate: add( new WindowCloseButton( pCloseClickListener ) ); |
31 |
|
- |
} |
32 |
|
- |
|
33 |
|
- |
public String getTitleBarTitle() { |
34 |
|
- |
return mTitle.getText(); |
35 |
|
- |
} |
36 |
|
- |
|
37 |
|
- |
public void setTitleBarTitle( String pTitle ) { |
38 |
|
- |
mTitle.setText( pTitle ); |
39 |
|
- |
relayoutFromHereDown(); |
40 |
|
- |
} |
41 |
|
- |
|
42 |
|
- |
public String getFactoryRef() { |
43 |
|
- |
return mFactoryRef; |
44 |
|
- |
} |
45 |
|
- |
|
46 |
|
- |
public void setFactoryRef( String pFactoryRef ) { |
47 |
|
- |
mFactoryRef = pFactoryRef; |
48 |
|
- |
} |
49 |
|
- |
} |
|
1 |
+ |
// This Source Code is in the Public Domain per: http://unlicense.org |
|
2 |
+ |
package org.litesoft.GWT.client.widgets.nonpublic; |
|
3 |
+ |
|
|
4 |
+ |
import org.litesoft.GWT.client.iconservice.*; |
|
5 |
+ |
import org.litesoft.GWT.client.widgets.*; |
|
6 |
+ |
|
|
7 |
+ |
import com.google.gwt.user.client.ui.*; |
|
8 |
+ |
|
|
9 |
+ |
public class CloseableIconFloaterPanelTitleBar extends FloaterTitleBar { |
|
10 |
+ |
protected SimpleLabel mTitle = new SimpleLabel( "" ); |
|
11 |
+ |
private String mFactoryRef; |
|
12 |
+ |
|
|
13 |
+ |
public CloseableIconFloaterPanelTitleBar( String pForm, String pFactoryRef, String pTitle, |
|
14 |
+ |
ClickListener pCloseClickListener ) { |
|
15 |
+ |
mTitle.setStyleName( "litesoft-" + pForm + "BarCaption" ); |
|
16 |
+ |
setVerticalAlignment( ALIGN_MIDDLE ); |
|
17 |
+ |
setTitleBarTitle( pTitle ); |
|
18 |
+ |
setFactoryRef( pFactoryRef ); |
|
19 |
+ |
buildTitleBar( pCloseClickListener ); |
|
20 |
+ |
} |
|
21 |
+ |
|
|
22 |
+ |
protected void buildTitleBar( ClickListener pCloseClickListener ) { |
|
23 |
+ |
IconService.DefinitionPlus definition = IconServiceLocator.get().getDefinition( getFactoryRef(), // |
|
24 |
+ |
getTitleBarTitle() ); |
|
25 |
+ |
add( new Image( definition.getDefinition().getSmallIconURL() ) ); |
|
26 |
+ |
add( new Spacer().width( 5 ) ); |
|
27 |
+ |
add( mTitle ); |
|
28 |
+ |
add( new Spacer().width( 5 ) ); |
|
29 |
+ |
add( new SizeableSpacer().stretchableHorizontally() ); |
|
30 |
+ |
// todo: translate: add( new WindowCloseButton( pCloseClickListener ) ); |
|
31 |
+ |
} |
|
32 |
+ |
|
|
33 |
+ |
public String getTitleBarTitle() { |
|
34 |
+ |
return mTitle.getText(); |
|
35 |
+ |
} |
|
36 |
+ |
|
|
37 |
+ |
public void setTitleBarTitle( String pTitle ) { |
|
38 |
+ |
mTitle.setText( pTitle ); |
|
39 |
+ |
relayoutFromHereDown(); |
|
40 |
+ |
} |
|
41 |
+ |
|
|
42 |
+ |
public String getFactoryRef() { |
|
43 |
+ |
return mFactoryRef; |
|
44 |
+ |
} |
|
45 |
+ |
|
|
46 |
+ |
public void setFactoryRef( String pFactoryRef ) { |
|
47 |
+ |
mFactoryRef = pFactoryRef; |
|
48 |
+ |
} |
|
49 |
+ |
} |