Permalink
Browse files

Deleted unused initial classes

  • Loading branch information...
1 parent 983933a commit a7e492345a9516dfa61d1715418a507699209aaa @nfrankel nfrankel committed Jun 2, 2012
View
134 custom-component-example/src/main/java/com/morevaadin/vaadin7/custom/Button.java
@@ -1,134 +0,0 @@
-/*
- * Copyright 2012 Nicolas Frankel
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.morevaadin.vaadin7.custom;
-
-import java.lang.reflect.Method;
-
-import com.morevaadin.vaadin7.custom.client.ui.ButtonState;
-import com.vaadin.ui.AbstractComponent;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Button.ClickListener;
-
-@SuppressWarnings("serial")
-public class Button extends AbstractComponent {
-
- /** Copied from {@link com.vaadin.ui.Button}. */
- private static final Method BUTTON_CLICK_METHOD;
-
- static {
-
- try {
-
- BUTTON_CLICK_METHOD = ClickListener.class.getDeclaredMethod(
- "buttonClick", new Class[] { ClickEvent.class });
-
- } catch (final java.lang.NoSuchMethodException e) {
-
- throw new java.lang.RuntimeException(
- "Internal error finding methods in Button");
- }
- }
-
- public enum Size {
-
- LARGE, DEFAULT, SMALL, MINI;
- }
-
- public enum Type {
-
- DEFAULT, PRIMARY, INFO, SUCCESS, WARNING, DANGER, INVERSE;
- }
-
- public Button() {
-
- this("", Type.DEFAULT, Size.DEFAULT);
-
- setImmediate(true);
- }
-
- public Button(String caption, Size size) {
-
- this(caption, Type.DEFAULT, size);
- }
-
- public Button(String caption, Type type) {
-
- this(caption, type, Size.DEFAULT);
- }
-
- public Button(String caption, Type type, Size size) {
-
- setText(caption);
- setSize(size);
- setType(type);
- }
-
- public Button(String caption) {
-
- this(caption, Size.DEFAULT);
- }
-
- public Button(Size size) {
-
- this("", size);
- }
-
- public Button(Type type) {
-
- this("", type);
- }
-
- public void addListener(ClickListener listener) {
-
- addListener(ClickEvent.class, listener, BUTTON_CLICK_METHOD);
- }
-
- public Size getSize() {
-
- return Size.valueOf(getState().getSize());
- }
-
- public Type getType() {
-
- return Type.valueOf(getState().getType());
- }
-
- @Override
- public ButtonState getState() {
-
- return (ButtonState) super.getState();
- }
-
- public String getText() {
-
- return getState().getText();
- }
-
- public void setSize(Size size) {
-
- getState().setSize(size.toString());
- }
-
- public void setType(Type size) {
-
- getState().setType(size.toString());
- }
-
- public void setText(String text) {
-
- getState().setText(text);
- }
-}
View
24 ...ample/src/main/java/com/morevaadin/vaadin7/custom/client/ui/BootstrapButtonServerRpc.java
@@ -1,24 +0,0 @@
-/*
- * Copyright 2012 Nicolas Frankel
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.morevaadin.vaadin7.custom.client.ui;
-
-import com.vaadin.terminal.gwt.client.MouseEventDetails;
-import com.vaadin.terminal.gwt.client.communication.ServerRpc;
-
-public interface BootstrapButtonServerRpc extends ServerRpc {
-
- void click(MouseEventDetails mouseEventDetails);
-}
View
81 ...ponent-example/src/main/java/com/morevaadin/vaadin7/custom/client/ui/ButtonConnector.java
@@ -1,81 +0,0 @@
-/*
- * Copyright 2012 Nicolas Frankel
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.morevaadin.vaadin7.custom.client.ui;
-
-import com.github.gwtbootstrap.client.ui.constants.ButtonType;
-import com.github.gwtbootstrap.client.ui.resources.ButtonSize;
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.user.client.ui.Widget;
-import com.vaadin.terminal.gwt.client.MouseEventDetails;
-import com.vaadin.terminal.gwt.client.MouseEventDetailsBuilder;
-import com.vaadin.terminal.gwt.client.communication.RpcProxy;
-import com.vaadin.terminal.gwt.client.communication.StateChangeEvent;
-import com.vaadin.terminal.gwt.client.ui.AbstractComponentConnector;
-import com.vaadin.terminal.gwt.client.ui.Connect;
-import com.vaadin.terminal.gwt.client.ui.button.ButtonServerRpc;
-
-@SuppressWarnings("serial")
-@Connect(com.morevaadin.vaadin7.custom.Button.class)
-public class ButtonConnector extends AbstractComponentConnector implements ClickHandler {
-
- /** Copied from {@link com.vaadin.terminal.gwt.client.ui.button.ButtonConnector}. */
- private ButtonServerRpc rpc = RpcProxy.create(ButtonServerRpc.class, this);
-
- @Override
- protected Widget createWidget() {
-
- return GWT.create(VButton.class);
- }
-
- @Override
- public ButtonState getState() {
-
- return (ButtonState) super.getState();
- }
-
- @Override
- public VButton getWidget() {
-
- return (VButton) super.getWidget();
- }
-
- @Override
- public void onStateChanged(StateChangeEvent stateChangeEvent) {
-
- super.onStateChanged(stateChangeEvent);
-
- ButtonState state = getState();
-
- VButton button = getWidget();
-
- button.setText(state.getText());
- button.setSize(ButtonSize.valueOf(state.getSize()));
- button.setType(ButtonType.valueOf(state.getType()));
- }
-
- /**
- * Copied from {@link com.vaadin.terminal.gwt.client.ui.button.ButtonConnector}.
- */
- public void onClick(ClickEvent event) {
-
- MouseEventDetails details = MouseEventDetailsBuilder.buildMouseEventDetails(
- event.getNativeEvent(), getWidget().getElement());
-
- rpc.click(details);
- }
-}
View
58 ...-component-example/src/main/java/com/morevaadin/vaadin7/custom/client/ui/ButtonState.java
@@ -1,58 +0,0 @@
-/*
- * Copyright 2012 Nicolas Frankel
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.morevaadin.vaadin7.custom.client.ui;
-
-import com.vaadin.terminal.gwt.client.ComponentState;
-
-@SuppressWarnings("serial")
-public class ButtonState extends ComponentState {
-
- private String text = "";
-
- private String type = "DEFAULT";
-
- private String size = "DEFAULT";
-
- public String getSize() {
-
- return size;
- }
-
- public String getText() {
-
- return text;
- }
-
- public String getType() {
-
- return type;
- }
-
- public void setSize(String size) {
-
- this.size = size;
- }
-
- public void setText(String text) {
-
- this.text = text;
- }
-
- public void setType(String type) {
-
- this.type = type;
- }
-}
View
26 custom-component-example/src/main/java/com/morevaadin/vaadin7/custom/client/ui/VButton.java
@@ -1,26 +0,0 @@
-/*
- * Copyright 2012 Nicolas Frankel
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.morevaadin.vaadin7.custom.client.ui;
-
-import com.github.gwtbootstrap.client.ui.Button;
-
-public class VButton extends Button {
-
- public VButton() {
-
- addStyleName("v-button-bootstrap");
- }
-}

0 comments on commit a7e4923

Please sign in to comment.