Skip to content

Commit

Permalink
Cleaned up the editor styles
Browse files Browse the repository at this point in the history
  • Loading branch information
bradseefeld committed Oct 13, 2011
1 parent 25ef5c8 commit 1c296a3
Show file tree
Hide file tree
Showing 8 changed files with 91 additions and 34 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<properties>
<gwt.version>2.4.0</gwt.version>
<plugin.gwt.version>2.4.0</plugin.gwt.version>
<plugin.gwt.version>2.3.0</plugin.gwt.version>
<slf4j.version>1.6.1</slf4j.version>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/bradley/gwt/demo/user/client/TestApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.util.List;
import java.util.Set;

import com.bradley.gwt.demo.user.client.editor.EmployeeEditor;
import com.bradley.gwt.demo.user.client.entity.EmployeeProxy;
import com.bradley.gwt.demo.user.client.request.EmployeeRequestFactory;
import com.bradley.gwt.user.client.animation.MoveAnimation;
Expand All @@ -21,7 +22,6 @@
import com.bradley.gwt.user.client.ui.ComboBox;
import com.bradley.gwt.user.client.ui.DateTimeEditor;
import com.bradley.gwt.user.client.ui.Dialog;
import com.bradley.gwt.user.client.ui.EditorPanel;
import com.bradley.gwt.user.client.ui.MenuButton;
import com.bradley.gwt.user.client.ui.Notifier;
import com.bradley.gwt.user.client.ui.Renderer;
Expand Down Expand Up @@ -51,12 +51,12 @@ public class TestApp implements EntryPoint {
@Override
public void onModuleLoad() {

demoCellTableDialog();
//demoCellTableDialog();
//demoNotifications();
//demoMoveAnimation();
//demoButtons();
//demoDualListBox();
//demoEditorPanel();
demoEditorPanel();
//demoMasking();
//demoDialog();
//demoComboBox();
Expand Down Expand Up @@ -172,7 +172,7 @@ protected void demoMasking() {
//Mask.mask(element.getElement());
}
protected void demoEditorPanel() {
EditorPanel editor = new EditorPanel();
EmployeeEditor editor = new EmployeeEditor();
RootPanel.get().add(editor);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.bradley.gwt.user.client.resource;

import com.google.gwt.resources.client.CssResource;

public interface EditorPanelCssResource extends CssResource {

}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ public interface UIClientBundle extends ClientBundle {

@Source("image/tick.png")
ImageResource tick();

@Source("css/editor-panel.css")
EditorPanelCssResource getEditorCssResource();
}
7 changes: 6 additions & 1 deletion src/main/java/com/bradley/gwt/user/client/ui/Button.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import com.bradley.gwt.user.client.resource.ButtonResources;
import com.bradley.gwt.user.client.resource.ButtonResources.Style;
import com.bradley.gwt.user.client.resource.UIClientBundle;
import com.bradley.gwt.user.client.resource.UICssResource;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.PushButton;

Expand All @@ -16,6 +18,8 @@ public class Button extends PushButton {

protected Style css;

private static final UICssResource _css = UIClientBundle.INSTANCE.getUICssResource();

public Button(String label, ButtonResources resources) {
setHTML(label);

Expand All @@ -24,7 +28,8 @@ public Button(String label, ButtonResources resources) {

addStyleName(css.button());

css.ensureInjected();
css.ensureInjected();
_css.ensureInjected();
}

public Button(String label) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/bradley/gwt/user/client/ui/EditorPanel.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.bradley.gwt.user.client.ui;

import com.bradley.gwt.user.client.resource.EditorPanelCssResource;
import com.bradley.gwt.user.client.resource.UIClientBundle;
import com.bradley.gwt.user.client.resource.UICssResource;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
import com.google.gwt.editor.client.Editor;
Expand All @@ -25,7 +25,7 @@
*/
public class EditorPanel<T> extends Composite implements Editor<T> {

protected static final UICssResource css = UIClientBundle.INSTANCE.getUICssResource();
protected static final EditorPanelCssResource css = UIClientBundle.INSTANCE.getEditorCssResource();

public EditorPanel() {
css.ensureInjected();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
@external .label-field, .label, .required, .empty;

input[type=text],
input[type=password],
textarea {
-webkit-transition: border linear 0.2s, box-shadow linear 0.2s;
-moz-transition: border linear 0.2s, box-shadow linear 0.2s;
-ms-transition: border linear 0.2s, box-shadow linear 0.2s;
-o-transition: border linear 0.2s, box-shadow linear 0.2s;
transition: border linear 0.2s, box-shadow linear 0.2s;
-webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
-moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
outline: none;
}

input[type=text],
input[type=password],
textarea,
select {
border: 1px solid #CCC;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
padding: 4px;
color: gray;
font-size: 13px;
}

.label-field {
margin-bottom: 5px;
}

.label-field input[type=text],
.label-field input[type=password],
.label-field textarea {
width: 230px;
}

.label-field textarea {
height: 100px;
}

.label-field div {
display: inline-block;
}

.label-field .label,
.label-field label {
padding-top: 6px;
text-align: right;
vertical-align: top;
color: #404040;
}

.label-field.required .label,
.label-field.required label {
font-weight: bold;
}

.label-field .empty {
color: #999;
font-style: italic;
}
30 changes: 4 additions & 26 deletions src/main/resources/com/bradley/gwt/user/client/resource/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,12 @@ div:focus {
-webkit-border-radius: 3px;
-khtml-border-radius: 3px;
}
@external .label-field, .label, .required, .empty;
.label-field {
margin-bottom: 5px;
}
.label-field input[type=text], .label-field textarea {
width: 230px;
}
.label-field textarea {
height: 100px;
}
.label-field div {
display: inline-block;
}
.label {
text-align: right;
vertical-align: top;
white-space: nowrap;
}
.label-field.required .label {
font-weight: bold;
}
.label-field .empty {
color: #999;
font-style: italic;
}

/* When there is no data available in a grid. */
.no-data {
font-size: 22px;
font-style: italic;
color: #999;
}
}


0 comments on commit 1c296a3

Please sign in to comment.