Browse Source

Suppressed warnings

Replaced deprecated classes with new ones

svn changeset:16017/svn branch:6.5
tags/6.7.0.beta1
Artur Signell 13 years ago
parent
commit
4d32a233c6

+ 2
- 3
src/com/vaadin/terminal/gwt/client/ApplicationConnection.java View File

private Set<Paintable> zeroHeightComponents = null; private Set<Paintable> zeroHeightComponents = null;


/** /**
* Keeps track of if there are (potentially) {@link DeferredCommand}s that
* are being executed. 0 == no DeferredCommands currently in progress, > 0
* Keeps track of if there are (potentially) deferred commands that are
* being executed. 0 == no deferred commands currently in progress, > 0
* otherwise. * otherwise.
*/ */
private int deferredCommandTrackers = 0; private int deferredCommandTrackers = 0;
* *
* @return * @return
*/ */
@SuppressWarnings("unused")
private boolean isExecutingDeferredCommands() { private boolean isExecutingDeferredCommands() {
return (deferredCommandTrackers > 0); return (deferredCommandTrackers > 0);
} }

+ 0
- 2
src/com/vaadin/terminal/gwt/client/DateTimeService.java View File

private String formatMonthNames(Date date, String formatStr) { private String formatMonthNames(Date date, String formatStr) {
if (formatStr.contains("MMMM")) { if (formatStr.contains("MMMM")) {
@SuppressWarnings("deprecation")
String monthName = getMonth(date.getMonth()); String monthName = getMonth(date.getMonth());
if (monthName != null) { if (monthName != null) {
if (formatStr.contains("MMM")) { if (formatStr.contains("MMM")) {
@SuppressWarnings("deprecation")
String monthName = getShortMonth(date.getMonth()); String monthName = getShortMonth(date.getMonth());
if (monthName != null) { if (monthName != null) {

+ 0
- 2
src/com/vaadin/terminal/gwt/client/HistoryImplIEVaadin.java View File

* untrusted string that may contain html * untrusted string that may contain html
* @return sanitized string * @return sanitized string
*/ */
@SuppressWarnings("unused")
private static String escapeHtml(String maybeHtml) { private static String escapeHtml(String maybeHtml) {
final Element div = DOM.createDiv(); final Element div = DOM.createDiv();
DOM.setInnerText(div, maybeHtml); DOM.setInnerText(div, maybeHtml);
* the fragment contains a '?'. To avoid this bug, we use location.href * the fragment contains a '?'. To avoid this bug, we use location.href
* instead. * instead.
*/ */
@SuppressWarnings("unused")
private static native String getLocationHash() private static native String getLocationHash()
/*-{ /*-{
var href = $wnd.location.href; var href = $wnd.location.href;

+ 2
- 0
src/com/vaadin/terminal/gwt/client/ui/CalendarEntry.java View File

private String description; private String description;
private boolean notime; private boolean notime;
@SuppressWarnings("deprecation")
public CalendarEntry(String styleName, Date start, Date end, String title, public CalendarEntry(String styleName, Date start, Date end, String title,
String description, boolean notime) { String description, boolean notime) {
this.styleName = styleName; this.styleName = styleName;
this.notime = notime; this.notime = notime;
} }
@SuppressWarnings("deprecation")
public String getStringForDate(Date d) { public String getStringForDate(Date d) {
// TODO format from DateTimeService // TODO format from DateTimeService
String s = ""; String s = "";

+ 2
- 0
src/com/vaadin/terminal/gwt/client/ui/VDateFieldCalendar.java View File

} }
@Override @Override
@SuppressWarnings("deprecation")
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
super.updateFromUIDL(uidl, client); super.updateFromUIDL(uidl, client);
calendarPanel.setShowISOWeekNumbers(isShowISOWeekNumbers()); calendarPanel.setShowISOWeekNumbers(isShowISOWeekNumbers());
/** /**
* TODO refactor: almost same method as in VPopupCalendar.updateValue * TODO refactor: almost same method as in VPopupCalendar.updateValue
*/ */
@SuppressWarnings("deprecation")
private void updateValueFromPanel() { private void updateValueFromPanel() {
Date date2 = calendarPanel.getDate(); Date date2 = calendarPanel.getDate();
Date currentDate = getCurrentDate(); Date currentDate = getCurrentDate();

+ 2
- 0
src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java View File

} }
@SuppressWarnings("deprecation")
private void updateValue(Date newDate) { private void updateValue(Date newDate) {
Date currentDate = getCurrentDate(); Date currentDate = getCurrentDate();
if (currentDate == null || newDate.getTime() != currentDate.getTime()) { if (currentDate == null || newDate.getTime() != currentDate.getTime()) {
* com.vaadin.terminal.gwt.client.ApplicationConnection) * com.vaadin.terminal.gwt.client.ApplicationConnection)
*/ */
@Override @Override
@SuppressWarnings("deprecation")
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
boolean lastReadOnlyState = readonly; boolean lastReadOnlyState = readonly;
parsable = uidl.getBooleanAttribute("parsable"); parsable = uidl.getBooleanAttribute("parsable");

+ 1
- 0
src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java View File

} }
} }


@SuppressWarnings("deprecation")
public void onChange(ChangeEvent event) { public void onChange(ChangeEvent event) {
if (!text.getText().equals("")) { if (!text.getText().equals("")) {
try { try {

+ 89
- 88
tests/src/com/vaadin/tests/layouts/OrderedLayoutBasics.java View File

import com.vaadin.ui.Layout; import com.vaadin.ui.Layout;
import com.vaadin.ui.Panel; import com.vaadin.ui.Panel;
import com.vaadin.ui.Select; import com.vaadin.ui.Select;
import com.vaadin.ui.TextArea;
import com.vaadin.ui.TextField; import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.VerticalLayout;
// ol.setWidth(""); // ol.setWidth("");
ol.setCaption("100 % filled with fixed width (" + ol.getWidth() ol.setCaption("100 % filled with fixed width (" + ol.getWidth()
+ "px) and fixed height (" + ol.getHeight() + "px)"); + "px) and fixed height (" + ol.getHeight() + "px)");
TextField tf;
tf = new TextField();
tf.setCaption("This one has a caption");
tf.setValue("60% expand TextField");
tf.setWidth("100%");
tf.setHeight("100%");
// tf.setRequired(true);
// tf.setComponentError(new UserError("It's broken!"));
// tf.setHeight("100%");
// tf.setWidth("100px");
tf.setRows(2);
ol.addComponent(tf);
ol.setExpandRatio(tf, 60);
tf = new TextField();
tf.setValue("100px 100px TextField");
tf.setWidth("100px");
tf.setHeight("100px");
tf.setRows(2);
ol.addComponent(tf);
ol.setComponentAlignment(tf, Alignment.MIDDLE_CENTER);
TextArea ta;
ta = new TextArea();
ta.setCaption("This one has a caption");
ta.setValue("60% expand TextField");
ta.setWidth("100%");
ta.setHeight("100%");
// ta.setRequired(true);
// ta.setComponentError(new UserError("It's broken!"));
// ta.setHeight("100%");
// ta.setWidth("100px");
ta.setRows(2);
ol.addComponent(ta);
ol.setExpandRatio(ta, 60);
ta = new TextArea();
ta.setValue("100px 100px TextField");
ta.setWidth("100px");
ta.setHeight("100px");
ta.setRows(2);
ol.addComponent(ta);
ol.setComponentAlignment(ta, Alignment.MIDDLE_CENTER);
// //
tf = new TextField("40%x40% Field");
// tf.setCaption(null);
tf.setValue("40% expand (40% height) TextField");
tf.setWidth("100%");
tf.setHeight("40%");
ol.addComponent(tf);
ol.setExpandRatio(tf, 40);
// tf.setRequired(true);
ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT);
ta = new TextArea("40%x40% Field");
// ta.setCaption(null);
ta.setValue("40% expand (40% height) TextField");
ta.setWidth("100%");
ta.setHeight("40%");
ol.addComponent(ta);
ol.setExpandRatio(ta, 40);
// ta.setRequired(true);
ol.setComponentAlignment(ta, Alignment.BOTTOM_RIGHT);
tf.setRows(2);
ta.setRows(2);
return ol; return ol;
} }
// ol.setWidth(""); // ol.setWidth("");
ol.setCaption("100 % filled with fixed width (" + ol.getWidth() ol.setCaption("100 % filled with fixed width (" + ol.getWidth()
+ "px) and fixed height (" + ol.getHeight() + "px)"); + "px) and fixed height (" + ol.getHeight() + "px)");
TextField tf;
tf = new TextField();
// tf.setCaption("This one has a caption");
tf.setValue("80% x 20% TextField");
tf.setWidth("80%");
tf.setHeight("20%");
// tf.setRequired(true);
// tf.setComponentError(new UserError("It's broken!"));
// tf.setHeight("100%");
// tf.setWidth("100px");
tf.setRows(2);
ol.addComponent(tf);
TextArea ta;
ta = new TextArea();
// ta.setCaption("This one has a caption");
ta.setValue("80% x 20% TextField");
ta.setWidth("80%");
ta.setHeight("20%");
// ta.setRequired(true);
// ta.setComponentError(new UserError("It's broken!"));
// ta.setHeight("100%");
// ta.setWidth("100px");
ta.setRows(2);
ol.addComponent(ta);
// //
tf = new TextField("20%x60% Field");
tf.setCaption(null);
tf.setValue("20% x 60% TextField");
tf.setWidth("20%");
tf.setHeight("60%");
// tf.setRequired(true);
ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT);
ta = new TextArea("20%x60% Field");
ta.setCaption(null);
ta.setValue("20% x 60% TextField");
ta.setWidth("20%");
ta.setHeight("60%");
// ta.setRequired(true);
ol.setComponentAlignment(ta, Alignment.BOTTOM_RIGHT);
tf.setRows(2);
ol.addComponent(tf);
ta.setRows(2);
ol.addComponent(ta);
return ol; return ol;
} }
// ol.setWidth(""); // ol.setWidth("");
ol.setCaption("Underfilled with fixed width (" + ol.getWidth() ol.setCaption("Underfilled with fixed width (" + ol.getWidth()
+ "px) and fixed height (" + ol.getHeight() + "px)"); + "px) and fixed height (" + ol.getHeight() + "px)");
TextField tf;
tf = new TextField("60%x100% Field");
tf.setCaption("Short capt");
tf.setValue("60% x 100% TextField");
tf.setWidth("60%");
tf.setHeight("100%");
tf.setRequired(true);
tf.setRows(2);
ol.addComponent(tf);
ol.setComponentAlignment(tf, Alignment.MIDDLE_CENTER);
tf = new TextField("200px x 200px Field");
// tf.setIcon(new ThemeResource("icons/16/document-add.png"));
tf.setValue("200x200 field");
tf.setRows(2);
// tf.setSizeFull();
tf.setHeight("200px");
tf.setWidth("200px");
ol.addComponent(tf);
ol.setComponentAlignment(tf, Alignment.TOP_LEFT);
tf = new TextField("200px x 200px Field");
// tf.setIcon(new ThemeResource("icons/16/document-add.png"));
tf.setValue("200x200 field");
tf.setRows(2);
// tf.setSizeFull();
tf.setHeight("200px");
tf.setWidth("200px");
ol.addComponent(tf);
ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT);
TextArea ta;
ta = new TextArea("60%x100% Field");
ta.setCaption("Short capt");
ta.setValue("60% x 100% TextField");
ta.setWidth("60%");
ta.setHeight("100%");
ta.setRequired(true);
ta.setRows(2);
ol.addComponent(ta);
ol.setComponentAlignment(ta, Alignment.MIDDLE_CENTER);
ta = new TextArea("200px x 200px Field");
// ta.setIcon(new ThemeResource("icons/16/document-add.png"));
ta.setValue("200x200 field");
ta.setRows(2);
// ta.setSizeFull();
ta.setHeight("200px");
ta.setWidth("200px");
ol.addComponent(ta);
ol.setComponentAlignment(ta, Alignment.TOP_LEFT);
ta = new TextArea("200px x 200px Field");
// ta.setIcon(new ThemeResource("icons/16/document-add.png"));
ta.setValue("200x200 field");
ta.setRows(2);
// ta.setSizeFull();
ta.setHeight("200px");
ta.setWidth("200px");
ol.addComponent(ta);
ol.setComponentAlignment(ta, Alignment.BOTTOM_RIGHT);
return ol; return ol;
} }

Loading…
Cancel
Save