Skip to content

Commit d376b89

Browse files
committed
Footer Recode
1 parent 9f7f254 commit d376b89

File tree

8 files changed

+124
-267
lines changed

8 files changed

+124
-267
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package gwt.material.design.client.custom;
2+
3+
/*
4+
* #%L
5+
* GwtMaterial
6+
* %%
7+
* Copyright (C) 2015 GwtMaterialDesign
8+
* %%
9+
* Licensed under the Apache License, Version 2.0 (the "License");
10+
* you may not use this file except in compliance with the License.
11+
* You may obtain a copy of the License at
12+
*
13+
* http://www.apache.org/licenses/LICENSE-2.0
14+
*
15+
* Unless required by applicable law or agreed to in writing, software
16+
* distributed under the License is distributed on an "AS IS" BASIS,
17+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
* See the License for the specific language governing permissions and
19+
* limitations under the License.
20+
* #L%
21+
*/
22+
23+
import com.google.gwt.dom.client.Document;
24+
25+
public class CustomDiv extends ComplexWidget {
26+
27+
public CustomDiv(){
28+
setElement(Document.get().createElement("div"));
29+
}
30+
31+
}
Lines changed: 56 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,107 +1,75 @@
11
package gwt.material.design.client.ui;
22

3-
/*
4-
* #%L
5-
* GwtMaterial
6-
* %%
7-
* Copyright (C) 2015 GwtMaterialDesign
8-
* %%
9-
* Licensed under the Apache License, Version 2.0 (the "License");
10-
* you may not use this file except in compliance with the License.
11-
* You may obtain a copy of the License at
12-
*
13-
* http://www.apache.org/licenses/LICENSE-2.0
14-
*
15-
* Unless required by applicable law or agreed to in writing, software
16-
* distributed under the License is distributed on an "AS IS" BASIS,
17-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18-
* See the License for the specific language governing permissions and
19-
* limitations under the License.
20-
* #L%
21-
*/
3+
import gwt.material.design.client.custom.ComplexWidget;
4+
import gwt.material.design.client.custom.CustomDiv;
5+
import gwt.material.design.client.custom.HasColors;
226

23-
import gwt.material.design.client.custom.CustomFooter;
24-
25-
import com.google.gwt.core.client.GWT;
26-
import com.google.gwt.dom.client.Style.Position;
27-
import com.google.gwt.dom.client.Style.Unit;
28-
import com.google.gwt.uibinder.client.UiBinder;
29-
import com.google.gwt.uibinder.client.UiChild;
30-
import com.google.gwt.uibinder.client.UiField;
31-
import com.google.gwt.user.client.ui.Composite;
32-
import com.google.gwt.user.client.ui.Label;
7+
import com.google.gwt.dom.client.Document;
338
import com.google.gwt.user.client.ui.Widget;
349

35-
public class MaterialFooter extends Composite {
3610

37-
private static MaterialFooterUiBinder uiBinder = GWT.create(MaterialFooterUiBinder.class);
11+
//@formatter:off
12+
/**
13+
* Footers are a great way to organize a lot of site navigation and information at the end of a page. This is where the user will look once hes finished scrolling through the current page or is looking for additional information about your website.
14+
* <h3>UiBinder Usage:</h3>
15+
*
16+
* <pre>
17+
* {@code
18+
<m:MaterialFooter backgroundColor="blue">
19+
<m:MaterialRow>
20+
<m:MaterialColumn grid="s12 m6 l6">
21+
<m:MaterialTitle fontSize="0.7" color="white" title="Join The Discussion" description="We provide Gitter Chat rooms in order for GWT Developers discussed and collaborate about GWT Material Design and Phonegap Integration."/>
22+
<m:MaterialButton ui:field="btnChat" text="CHAT" backgroundColor="blue lighten-2" waves="light"/>
23+
</m:MaterialColumn>
24+
<m:MaterialColumn grid="s12 m6 l6">
25+
<m:MaterialTitle fontSize="0.7" color="white" title="GWT Phonegap" description="We provide Gitter Chat rooms in order for GWT Developers discussed and collaborate about GWT Material Design and Phonegap Integration."/>
26+
<m:MaterialButton ui:field="btnDownloadPhonegap" text="GWT Material APK" backgroundColor="blue lighten-2" waves="light"/>
27+
</m:MaterialColumn>
28+
</m:MaterialRow>
29+
30+
<m:MaterialFooterCopyright backgroundColor="blue darken-1">
31+
<m:MaterialLabel text=" © 2014 Copyright Text"/>
32+
</m:MaterialFooterCopyright>
33+
</m:MaterialFooter> }
34+
* </pre>
35+
* </p>
36+
*
37+
* @author kevzlou7979
38+
* @see <a href="http://gwt-material-demo.herokuapp.com/#footer">Material Footer</a>
39+
*/
40+
//@formatter:on
41+
public class MaterialFooter extends ComplexWidget implements HasColors{
3842

39-
interface MaterialFooterUiBinder extends UiBinder<Widget, MaterialFooter> {
40-
}
41-
@UiField CustomFooter footerPanel;
42-
@UiField Label lblCopyright;
43-
@UiField MaterialPanel container;
44-
private String color = "";
45-
private String copyright = "";
46-
private String type = "";
4743

48-
public MaterialFooter() {
49-
initWidget(uiBinder.createAndBindUi(this));
50-
}
51-
52-
@UiChild(tagname = "content")
53-
public void onAddFooterContent(Widget w){
54-
container.add(w);
55-
}
44+
CustomDiv container = new CustomDiv();
5645

57-
58-
public String getColor() {
59-
return color;
60-
}
61-
62-
public void setColor(String color) {
63-
this.color = color;
64-
if(!color.isEmpty()) footerPanel.addStyleName(color);
65-
}
66-
67-
public String getCopyright() {
68-
return copyright;
69-
}
70-
71-
public void setCopyright(String copyright) {
72-
this.copyright = copyright;
73-
if(!copyright.isEmpty()) lblCopyright.setText(copyright);
74-
}
75-
76-
public String getType() {
77-
return type;
46+
public MaterialFooter() {
47+
setElement(Document.get().createElement("footer"));
48+
setStyleName("page-footer");
49+
container.setStyleName("container");
7850
}
7951

80-
public void setType(String type) {
81-
this.type = type;
82-
if(type.equals("fixed")){
83-
footerPanel.getElement().getStyle().setPosition(Position.FIXED);
84-
footerPanel.getElement().getStyle().setWidth(100, Unit.PCT);
85-
footerPanel.getElement().getStyle().setBottom(0, Unit.PCT);
52+
@Override
53+
public void add(Widget child) {
54+
if(child.getElement().getClassName().contains("footer-copyright")){
55+
super.add(child);
56+
}else{
57+
container.add(child);
58+
super.add(container);
8659
}
60+
8761
}
8862

89-
public CustomFooter getFooterPanel() {
90-
return footerPanel;
63+
@Override
64+
public void setBackgroundColor(String bgColor) {
65+
// TODO Auto-generated method stub
66+
addStyleName(bgColor);
9167
}
9268

93-
public void setFooterPanel(CustomFooter footerPanel) {
94-
this.footerPanel = footerPanel;
69+
@Override
70+
public void setTextColor(String textColor) {
71+
// TODO Auto-generated method stub
72+
addStyleName(textColor + "-text");
9573
}
96-
97-
public MaterialPanel getContainer() {
98-
return container;
99-
}
100-
101-
public void setContainer(MaterialPanel container) {
102-
this.container = container;
103-
}
104-
10574

106-
10775
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package gwt.material.design.client.ui;
2+
3+
import gwt.material.design.client.custom.ComplexWidget;
4+
import gwt.material.design.client.custom.CustomDiv;
5+
import gwt.material.design.client.custom.HasColors;
6+
7+
import com.google.gwt.dom.client.Document;
8+
import com.google.gwt.user.client.ui.Widget;
9+
10+
public class MaterialFooterCopyright extends ComplexWidget implements HasColors{
11+
12+
CustomDiv container = new CustomDiv();
13+
14+
public MaterialFooterCopyright() {
15+
setElement(Document.get().createDivElement());
16+
setStyleName("footer-copyright");
17+
container.setStyleName("container");
18+
}
19+
20+
@Override
21+
public void add(Widget child) {
22+
container.add(child);
23+
super.add(container);
24+
}
25+
26+
@Override
27+
public void setBackgroundColor(String bgColor) {
28+
// TODO Auto-generated method stub
29+
addStyleName(bgColor);
30+
}
31+
32+
@Override
33+
public void setTextColor(String textColor) {
34+
// TODO Auto-generated method stub
35+
addStyleName(textColor + "-text");
36+
}
37+
}

src/main/resources/gwt/material/design/client/ui/MaterialCollection.ui.xml

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/main/resources/gwt/material/design/client/ui/MaterialContainer.ui.xml

Lines changed: 0 additions & 30 deletions
This file was deleted.

src/main/resources/gwt/material/design/client/ui/MaterialDropDown.ui.xml

Lines changed: 0 additions & 45 deletions
This file was deleted.

src/main/resources/gwt/material/design/client/ui/MaterialFileInput.ui.xml

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)