Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

NullConsole.java 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * Copyright 2011 Vaadin Ltd.
  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.vaadin.terminal.gwt.client;
  17. import java.util.Set;
  18. import com.google.gwt.core.client.GWT;
  19. /**
  20. * Client side console implementation for non-debug mode that discards all
  21. * messages.
  22. *
  23. */
  24. public class NullConsole implements Console {
  25. @Override
  26. public void dirUIDL(ValueMap u, ApplicationConnection conn) {
  27. }
  28. @Override
  29. public void error(String msg) {
  30. GWT.log(msg);
  31. }
  32. @Override
  33. public void log(String msg) {
  34. GWT.log(msg);
  35. }
  36. @Override
  37. public void printObject(Object msg) {
  38. GWT.log(msg.toString());
  39. }
  40. @Override
  41. public void printLayoutProblems(ValueMap meta,
  42. ApplicationConnection applicationConnection,
  43. Set<ComponentConnector> zeroHeightComponents,
  44. Set<ComponentConnector> zeroWidthComponents) {
  45. }
  46. @Override
  47. public void log(Throwable e) {
  48. GWT.log(e.getMessage(), e);
  49. }
  50. @Override
  51. public void error(Throwable e) {
  52. // Borrow exception handling from VDebugConsole
  53. VDebugConsole.handleError(e, this);
  54. }
  55. @Override
  56. public void setQuietMode(boolean quietDebugMode) {
  57. }
  58. @Override
  59. public void init() {
  60. }
  61. }