Skip to content
This repository
Browse code

Deleted unused initial classes

  • Loading branch information...
commit a7e492345a9516dfa61d1715418a507699209aaa 1 parent 983933a
Nicolas Frankel authored June 02, 2012
134  custom-component-example/src/main/java/com/morevaadin/vaadin7/custom/Button.java
... ...
@@ -1,134 +0,0 @@
1  
-/*
2  
- * Copyright 2012 Nicolas Frankel
3  
- *
4  
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5  
- * use this file except in compliance with the License. You may obtain a copy of
6  
- * the License at
7  
- *
8  
- * http://www.apache.org/licenses/LICENSE-2.0
9  
- *
10  
- * Unless required by applicable law or agreed to in writing, software
11  
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12  
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13  
- * License for the specific language governing permissions and limitations under
14  
- * the License.
15  
- */
16  
-package com.morevaadin.vaadin7.custom;
17  
-
18  
-import java.lang.reflect.Method;
19  
-
20  
-import com.morevaadin.vaadin7.custom.client.ui.ButtonState;
21  
-import com.vaadin.ui.AbstractComponent;
22  
-import com.vaadin.ui.Button.ClickEvent;
23  
-import com.vaadin.ui.Button.ClickListener;
24  
-
25  
-@SuppressWarnings("serial")
26  
-public class Button extends AbstractComponent {
27  
-
28  
-	/** Copied from {@link com.vaadin.ui.Button}. */
29  
-    private static final Method BUTTON_CLICK_METHOD;
30  
-
31  
-    static {
32  
-    
33  
-    	try {
34  
-
35  
-    		BUTTON_CLICK_METHOD = ClickListener.class.getDeclaredMethod(
36  
-                    "buttonClick", new Class[] { ClickEvent.class });
37  
-        
38  
-    	} catch (final java.lang.NoSuchMethodException e) {
39  
-
40  
-            throw new java.lang.RuntimeException(
41  
-                    "Internal error finding methods in Button");
42  
-        }
43  
-    }
44  
-
45  
-    public enum Size {
46  
-
47  
-		LARGE, DEFAULT, SMALL, MINI;
48  
-	}
49  
-
50  
-	public enum Type {
51  
-
52  
-		DEFAULT, PRIMARY, INFO, SUCCESS, WARNING, DANGER, INVERSE;
53  
-	}
54  
-
55  
-	public Button() {
56  
-
57  
-		this("", Type.DEFAULT, Size.DEFAULT);
58  
-		
59  
-		setImmediate(true);
60  
-	}
61  
-
62  
-	public Button(String caption, Size size) {
63  
-
64  
-		this(caption, Type.DEFAULT, size);
65  
-	}
66  
-
67  
-	public Button(String caption, Type type) {
68  
-
69  
-		this(caption, type, Size.DEFAULT);
70  
-	}
71  
-
72  
-	public Button(String caption, Type type, Size size) {
73  
-
74  
-		setText(caption);
75  
-		setSize(size);
76  
-		setType(type);
77  
-	}
78  
-
79  
-	public Button(String caption) {
80  
-
81  
-		this(caption, Size.DEFAULT);
82  
-	}
83  
-
84  
-	public Button(Size size) {
85  
-
86  
-		this("", size);
87  
-	}
88  
-
89  
-	public Button(Type type) {
90  
-
91  
-		this("", type);
92  
-	}
93  
-
94  
-    public void addListener(ClickListener listener) {
95  
-
96  
-    	addListener(ClickEvent.class, listener, BUTTON_CLICK_METHOD);
97  
-    }
98  
-
99  
-	public Size getSize() {
100  
-
101  
-		return Size.valueOf(getState().getSize());
102  
-	}
103  
-
104  
-	public Type getType() {
105  
-
106  
-		return Type.valueOf(getState().getType());
107  
-	}
108  
-
109  
-	@Override
110  
-	public ButtonState getState() {
111  
-
112  
-		return (ButtonState) super.getState();
113  
-	}
114  
-
115  
-	public String getText() {
116  
-
117  
-		return getState().getText();
118  
-	}
119  
-
120  
-	public void setSize(Size size) {
121  
-
122  
-		getState().setSize(size.toString());
123  
-	}
124  
-
125  
-	public void setType(Type size) {
126  
-
127  
-		getState().setType(size.toString());
128  
-	}
129  
-
130  
-	public void setText(String text) {
131  
-
132  
-		getState().setText(text);
133  
-	}
134  
-}
24  ...om-component-example/src/main/java/com/morevaadin/vaadin7/custom/client/ui/BootstrapButtonServerRpc.java
... ...
@@ -1,24 +0,0 @@
1  
-/*
2  
- * Copyright 2012 Nicolas Frankel
3  
- *
4  
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5  
- * use this file except in compliance with the License. You may obtain a copy of
6  
- * the License at
7  
- *
8  
- * http://www.apache.org/licenses/LICENSE-2.0
9  
- *
10  
- * Unless required by applicable law or agreed to in writing, software
11  
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12  
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13  
- * License for the specific language governing permissions and limitations under
14  
- * the License.
15  
- */
16  
-package com.morevaadin.vaadin7.custom.client.ui;
17  
-
18  
-import com.vaadin.terminal.gwt.client.MouseEventDetails;
19  
-import com.vaadin.terminal.gwt.client.communication.ServerRpc;
20  
-
21  
-public interface BootstrapButtonServerRpc extends ServerRpc {
22  
-
23  
-	void click(MouseEventDetails mouseEventDetails);
24  
-}
81  custom-component-example/src/main/java/com/morevaadin/vaadin7/custom/client/ui/ButtonConnector.java
... ...
@@ -1,81 +0,0 @@
1  
-/*
2  
- * Copyright 2012 Nicolas Frankel
3  
- *
4  
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5  
- * use this file except in compliance with the License. You may obtain a copy of
6  
- * the License at
7  
- *
8  
- * http://www.apache.org/licenses/LICENSE-2.0
9  
- *
10  
- * Unless required by applicable law or agreed to in writing, software
11  
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12  
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13  
- * License for the specific language governing permissions and limitations under
14  
- * the License.
15  
- */
16  
-package com.morevaadin.vaadin7.custom.client.ui;
17  
-
18  
-import com.github.gwtbootstrap.client.ui.constants.ButtonType;
19  
-import com.github.gwtbootstrap.client.ui.resources.ButtonSize;
20  
-import com.google.gwt.core.client.GWT;
21  
-import com.google.gwt.event.dom.client.ClickEvent;
22  
-import com.google.gwt.event.dom.client.ClickHandler;
23  
-import com.google.gwt.user.client.ui.Widget;
24  
-import com.vaadin.terminal.gwt.client.MouseEventDetails;
25  
-import com.vaadin.terminal.gwt.client.MouseEventDetailsBuilder;
26  
-import com.vaadin.terminal.gwt.client.communication.RpcProxy;
27  
-import com.vaadin.terminal.gwt.client.communication.StateChangeEvent;
28  
-import com.vaadin.terminal.gwt.client.ui.AbstractComponentConnector;
29  
-import com.vaadin.terminal.gwt.client.ui.Connect;
30  
-import com.vaadin.terminal.gwt.client.ui.button.ButtonServerRpc;
31  
-
32  
-@SuppressWarnings("serial")
33  
-@Connect(com.morevaadin.vaadin7.custom.Button.class)
34  
-public class ButtonConnector extends AbstractComponentConnector implements ClickHandler {
35  
-
36  
-	/** Copied from {@link com.vaadin.terminal.gwt.client.ui.button.ButtonConnector}. */
37  
-	private ButtonServerRpc rpc = RpcProxy.create(ButtonServerRpc.class, this);
38  
-
39  
-	@Override
40  
-	protected Widget createWidget() {
41  
-
42  
-		return GWT.create(VButton.class);
43  
-	}
44  
-
45  
-	@Override
46  
-	public ButtonState getState() {
47  
-
48  
-		return (ButtonState) super.getState();
49  
-	}
50  
-
51  
-	@Override
52  
-	public VButton getWidget() {
53  
-
54  
-		return (VButton) super.getWidget();
55  
-	}
56  
-
57  
-	@Override
58  
-	public void onStateChanged(StateChangeEvent stateChangeEvent) {
59  
-
60  
-		super.onStateChanged(stateChangeEvent);
61  
-
62  
-		ButtonState state = getState();
63  
-
64  
-		VButton button = getWidget();
65  
-
66  
-		button.setText(state.getText());
67  
-		button.setSize(ButtonSize.valueOf(state.getSize()));
68  
-		button.setType(ButtonType.valueOf(state.getType()));
69  
-	}
70  
-
71  
-	/**
72  
-	 * Copied from {@link com.vaadin.terminal.gwt.client.ui.button.ButtonConnector}.
73  
-	 */
74  
-	public void onClick(ClickEvent event) {
75  
-
76  
-		MouseEventDetails details = MouseEventDetailsBuilder.buildMouseEventDetails(
77  
-				event.getNativeEvent(), getWidget().getElement());
78  
-
79  
-		rpc.click(details);
80  
-	}
81  
-}
58  custom-component-example/src/main/java/com/morevaadin/vaadin7/custom/client/ui/ButtonState.java
... ...
@@ -1,58 +0,0 @@
1  
-/*
2  
- * Copyright 2012 Nicolas Frankel
3  
- *
4  
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5  
- * use this file except in compliance with the License. You may obtain a copy of
6  
- * the License at
7  
- *
8  
- * http://www.apache.org/licenses/LICENSE-2.0
9  
- *
10  
- * Unless required by applicable law or agreed to in writing, software
11  
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12  
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13  
- * License for the specific language governing permissions and limitations under
14  
- * the License.
15  
- */
16  
-package com.morevaadin.vaadin7.custom.client.ui;
17  
-
18  
-import com.vaadin.terminal.gwt.client.ComponentState;
19  
-
20  
-@SuppressWarnings("serial")
21  
-public class ButtonState extends ComponentState {
22  
-
23  
-	private String text = "";
24  
-
25  
-	private String type = "DEFAULT";
26  
-
27  
-	private String size = "DEFAULT";
28  
-
29  
-	public String getSize() {
30  
-
31  
-		return size;
32  
-	}
33  
-
34  
-	public String getText() {
35  
-
36  
-		return text;
37  
-	}
38  
-
39  
-	public String getType() {
40  
-
41  
-		return type;
42  
-	}
43  
-
44  
-	public void setSize(String size) {
45  
-
46  
-		this.size = size;
47  
-	}
48  
-
49  
-	public void setText(String text) {
50  
-
51  
-		this.text = text;
52  
-	}
53  
-
54  
-	public void setType(String type) {
55  
-
56  
-		this.type = type;
57  
-	}
58  
-}
26  custom-component-example/src/main/java/com/morevaadin/vaadin7/custom/client/ui/VButton.java
... ...
@@ -1,26 +0,0 @@
1  
-/*
2  
- * Copyright 2012 Nicolas Frankel
3  
- *
4  
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5  
- * use this file except in compliance with the License. You may obtain a copy of
6  
- * the License at
7  
- *
8  
- * http://www.apache.org/licenses/LICENSE-2.0
9  
- *
10  
- * Unless required by applicable law or agreed to in writing, software
11  
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12  
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13  
- * License for the specific language governing permissions and limitations under
14  
- * the License.
15  
- */
16  
-package com.morevaadin.vaadin7.custom.client.ui;
17  
-
18  
-import com.github.gwtbootstrap.client.ui.Button;
19  
-
20  
-public class VButton extends Button {
21  
-
22  
-	public VButton() {
23  
-
24  
-		addStyleName("v-button-bootstrap");
25  
-	}
26  
-}

0 notes on commit a7e4923

Please sign in to comment.
Something went wrong with that request. Please try again.