replace-with and when-property-is . . using it based on browser / user.agent value?
All, I've seen a few examples where there is talk of substituting a class based on which browser is involved. So, I want to have one version of a class for Firefox, and one for everything else. I've tried the following, taken from examples I've found online: ?xml version=1.0 encoding=UTF-8? module inherits name=com.sencha.gxt.theme.base.Base / replace-with class=com.joev.tests.client.MultiplierAdjustmentFirefox when-type-is class=com.joev.tests.client.MultiplierAdjustment / when-property-is name=user.agent value=firefox / /replace-with /module However, it doesn't seem to work. I'm pretty sure the value isn't just firefox but I don't know what to put in there. Or it may be the static method doing the instantiation of the MultiplierAdjustment class. Basically I want any version of Firefox to use the MultiplierAdjustmentFirefox class, and other browsers (so far we're only supporting Chrome and IE) to use the MultiplierAdjustment class. Here's the basic code I used to test it: GenericOutput.java (yeah, I'm not very creative with my names): public class GenericOutput implements EntryPoint { @Override public void onModuleLoad() { RootPanel.get().add(new Label(GenericStuff.getClassNameForInstance() + has a value of: + GenericStuff.getMultiplierValue())); } } GenericStuff.java: public class GenericStuff { private static MultiplierAdjustment instance; private static MultiplierAdjustment getInstance() { if(instance == null) { instance = new MultiplierAdjustment(); } return instance; } public static String getClassNameForInstance() { return getInstance().getClass().getName(); } public static double getMultiplierValue() { return getInstance().getMultiplier(); } } MultiplierAdjustment.java: public class MultiplierAdjustment { public double getMultiplier() { return 1.3; } } MultiplierAdjustmentFirefox.java: public class MultiplierAdjustmentFirefox { public double getMultiplier() { return 1.07; } } So, why am I getting output saying: com.joev.tests.client.MultiplierAdjustment has a value of: 1.3 How do I get this to work correctly? Thanks in advance -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/gaFuEob_9xgJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
GWT, dependent projects, GWT Compiling, and deploying
All, I'm not sure how exactly this is supposed to be accomplished, but... I have a GWT project that has no Entry Point. It is basically a number of classes, etc., that will be shared among different projects. A common library, if you will. And, I have a project that I'm actually working on, that depends on the Common project. I am using GWT 2.4, and am developing through Eclipse. Now, when I run in debug mode, everything works fine. At this point, though, I want to perform a GWT compile through Eclipse, and then I have a build.xml that will grab the files from the war directory, and create a .war file. Unfortunately, when I put together the .war file and deploy it on my Apache server, I notice an exception that a class couldn't be found - it's one of the classes from the Common project. 1) Does the GWT compile, when compiling and writing the various files to war/(myprojectname), war/deploy, etc etc actually compile the code from the Common project and put it in here as well? 1a) If so, then why am I getting the exception? 1b) If not, then how do I correctly compile the Common project (since it has no entry point) and include it in my main project? Thanks. I get the feeling I'm missing something right in front of my face, but can't figure out what it is. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/iQhSY2OR3XwJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: GWT, dependent projects, GWT Compiling, and deploying
Jens, Thanks for your reply - my issue was related to what you suggested - it turns out that my Common project has no server classes, but a number of classes in the shared package, which are extended by classes in the main project's shared package, which those in turn are used by the main project's server classes. Ultimately, though, including copying the common-project/war/WEB-INF/classes directory into the .war file was the solution. Thank you! - Joe -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/aIFWly5DMDcJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Using the Frame class, and adding Elements to it directly - doesn't display?
Thomas, Thanks. I think I might be missing something very obvious, because I'm looking at the APIs, and I have no idea how to do what you're suggesting. Code-wise, how do I get the document within the frame, so that I can add the new Elements to it? - Joe On Jun 5, 6:24 pm, Thomas Broyer t.bro...@gmail.com wrote: You're adding your elements as children of the frame, which is used as a fallback in case the browser does support frames. You should add them to the document that's displayed within the frame. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Using the Frame class, and adding Elements to it directly - doesn't display?
Thanks, that helped a lot, works as expected now! - Joe On Jun 6, 12:46 pm, Thomas Broyer t.bro...@gmail.com wrote: On Wednesday, June 6, 2012 6:13:04 PM UTC+2, King_V wrote: Thomas, Thanks. I think I might be missing something very obvious, because I'm looking at the APIs, and I have no idea how to do what you're suggesting. Code-wise, how do I get the document within the frame, so that I can add the new Elements to it? Frame frame = ...; FrameElement frameElt = frame.getElement().cast(); Document frameDoc = frameElt.getContentDocument(); You'll probably have to attach your Frame first, and possibly even wait for the LoadHandler to be called back (even for an about:blank) -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Using the Frame class, and adding Elements to it directly - doesn't display?
All, I've got this very short program, and I don't understand why it's not working. I am creating a Frame object, trying to append element children to it, and while the Frame instance seems to be aware of its children, they do not get displayed. Here is what I have. What am I doing wrong? When I attach to the RootPanel, I get a blank rectangular square with nothing in it. Inspection with Firebug also shows that the head and body elements are empty. public class TestFrameAndElement implements EntryPoint { public void onModuleLoad() { Frame frame = new Frame(); Element html = DOM.createElement(html); Element head = DOM.createElement(head); Element body = DOM.createElement(body); Element element = DOM.createElement(div); element.setInnerHTML(spanhello/spanspan style=\color: blue; \goodbye/span); html.appendChild(head); html.appendChild(body); body.appendChild(element); frame.getElement().appendChild(html); RootPanel.get().add(frame); System.out.println(Frame children: + frame.getElement().getChildCount()); System.out.println(HTML children : + frame.getElement().getChild(0).getChildCount()); System.out.println(HEAD children : + frame.getElement().getChild(0).getChild(0).getChildCount()); System.out.println(BODY children : + frame.getElement().getChild(0).getChild(1).getChildCount()); System.out.println(DIV children : + frame.getElement().getChild(0).getChild(1).getChild(0).getChildCount()); } } I've also noticed that if I do NOT add any elements, there is still an html/head/body in the Frame section when I inspect with Firebug, but in the code, the first sysout returns 0 and of course I have to comment out the rest of the sysout statements. How do I correctly work with this? Thanks. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
PopupPanel.showRelativeTo an individual date on a DatePicker?
Can this be done? I am not using any extensions or other libraries, just GWT 2.4 itself. I have a screen that is used for scheduling, and thus shows several DatePickers next to each other, each showing a different month, and with the month-forward and month-back buttons disabled. Some of the individual dates will have a marking indicating that events or meetings are scheduled. What I would like is to be able to have the user hover over the marked date, and have a PopupPanel appear and show the details of what's scheduled. More or less I have this working - however, while I can center() the PopupPanel, it's relatively small, and I want to show it near the date that's actually being hovered over. The best I've been able to manage thus far is PopupPanel.showRelativeTo(datePickerInstance). This is the sort of behavior I want (show below, to left, to right, above, whatever, based on how much room there is on the client), but I would like it to be relative to the individual date within the DatePicker, rather than relative to the entire DatePicker itself. Is it possible to get a handle to the UIObject that shows the date (ie: the 17, for, say, July 17th), and thus show the PopupPanel relative to that? Thanks in advance. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Appearance Pattern - ok, is there a better explanation, a tutorial, a step-by-step?
All, Ok, I've read the article at http://code.google.com/p/google-web-toolkit/wiki/CellBackedWIdgets in dealing with the Cell-backed Widgets, and I can't say I'm any better off than I was before reading it. First, the following line: getCell().setTabIndex(tabIndex); doesn't work at all - it requires a typecast. Second, I don't understand how/why the methods for the Appearance interface are chosen. Why are the methods called onHover and onUnhover as opposed to, say onMouseOver and onMouseOut, or heck, any other arbitrary names? Third, and related to that, what determines the parameters for these methods? Who/what is calling them, and how would I know, for example, that not only does the mouseover method need to be called onHover in the interface, and how would I know that it would need to be passed in a Context, and Element, and a String? Is there some sort of tutorial on this that goes step by step and uses examples? I am really lost with this. I've also read the Appearance Design Pattern article at Sencha as used with GXT, but it doesn't clarify things much more over the original. Thanks in advance -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Multiple DialogBoxes, bringing one to the front of others - a conundrum.
What you've suggested appears to ALMOST work. I have two styles in my CSS one called activeWindow and the other called nonWindowZIndex The former has a z-index of 1, the latter of 2. The trick I found was that I could not add the nonWindowZIndex style to the MenuBar objects. It has to apply to the gwt-MenuBarPopup style that was frustrating until I finally figured that bit out. Now I'm hoping I don't run into any other oddities like that! Otherwise, so far so good - thanks for the pointer. On Nov 24, 7:39 am, geert3 geert.coelm...@gmail.com wrote: use a CSS class e.g active that has a higher z-index. Only the clicked window shall have that class, causing it pop up in front the others. (basically your approach 1). popup menus etc need to have a fixed z-index higher than the active window. i don't see further problems with that? -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: DialogBoxes and MenuBars . . . zIndexing a bad thing?
For anyone who has actually followed this - my solution (the hide() followed by show()) is not actually a particularly viable solution. It works, more or less, as long as there are no items inside the Window (the class that extends DialogBox), such as Buttons, TextBoxes, etc. In Firefox 5, a Button will still work, but a TextBox will never be able to get focus. In IE8, a Button will require a double-click to work, but a TextBox can still be used correctly. I don't know what other side effects will happen with other Widgets. Back to the drawing board On Nov 11, 4:17 pm, King_V kin...@mindless.com wrote: Well, this is embarrassing, but maybe the answer will help someone else who's run into the same problem. Override the onBrowserEvent() method in my own subclass of DialogBox as follows: @Override public void onBrowserEvent(Event event) { switch(event.getTypeInt()) { case Event.ONMOUSEDOWN: hide(); show(); } super.onBrowserEvent(event); } And that does it, with no ill effects in terms of obscuring the MenuBar objects. Sheesh, I must now hold the record for shortest time between someone posting and answering their own question! -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Multiple DialogBoxes, bringing one to the front of others - a conundrum.
All, Ok, so I'm still, after a bit of hiatus, trying to create a Window- type of class that extends DialogBox. I'm going to call it MyWindow for now. I'm MOST of the way there. I've been able to create a Caption class that will have minimize, maximize, and close buttons. I've been able to get it to change the cursor for a resizable MyWindow - though I haven't yet implemented the code that does the resizing. The real roadblock I have right now is how to bring one of the MyWindow objects to the front of the others. Normally, DialogBox will have the most recently shown one in front of previous ones. Now, they ALL seem to have a z-index of 0. Yet, obviously, there are some on top of others. For the MyWindow class, I want to be able to click on one of these objects, and have it brought to the front. Two solutions I've tried have drawbacks that make them non-viable solutions. 1 - If I rely on incrementing the zIndex, other objects, such as menu items in a MenuBar, wind up being concealed by any MyWindow that's in the area. 2 - Using the hide() followed by show() in an override of onBrowserEvent solved that problem, but introduced issues with being unable to focus on certain components inside the MyWindow. I have detailed what I've encountered in the thread DialogBoxes and MenuBars . . . zIndexing a bad thing? located at: http://groups.google.com/group/google-web-toolkit/browse_thread/thread/9a819fd58c9a15bb/ea04ac89956cda4c So, my question - how do I get around this? How can I get true window- like behavior, being able to pop a MyWindow up in front of other MyWindow objects, without these unintended side-effects? Any help on this matter would be GREATLY appreciated! -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Detect mouse position when click on DatePicker?
All, Ok, I'm sure the question can be applied more generically - however, I figured I'd ask it for my particular problem. I have a DatePicker, and a class that implements ValueChangeHandlerDate What I want to do is figure out the mouse's absolute x and y position on the browser window when this happens. Is this possible? If so, how? Thanks in advance... -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
DialogBoxes and MenuBars . . . zIndexing a bad thing?
All, I'm working on my ever-evolving bit of code, and have run across something of an issue. My apologies for the lengthy prelude before I get to the actual question. Firstly, I have a full-browser-screen display - a DockLayoutPanel. Within it are a: MenuBar - NORTH FlowPanel - SOUTH Now, there's a big empty section in the middle, which is fine because that's what I want. The MenuBar looks like a typical application - File, with sub-items Open, Close, etc. Edit, with sub-items Copy, Paste, etc. I have also created a, for lack of a better term, WindowPrototype class that extends DialogBox. It has a close button, minimize, and maximize. I have not yet done draggable resizing with the corners and edges. So, my test code basically, when an item in the menu is chosen, it launches one of my WindowPrototype objects (which is mostly empty, just some text to show which item in the menu launched it). Now, of course, by default, DialogBox does not allow popping up of non- modal instances of itself over each other. The LAST one shown is ALWAYS on top - clicking on a partially hidden one does NOT bring it to the top. To get around this, I used a trick I came across on a web-search which puts a static int in the class that extends DialogBox (in my case, the WindowPrototype class), and increments it every time a new WindowPrototype is opened, or one is clicked to be brought to the top. This actually works fine as far as my WindowPrototype objects are concerned. However, when I do this, then there's a problem with the MenuBar items. If I click on a menu item, say File, then the subitems (Open, Close, etc) are shown UNDER any WindowPrototype object that happens to be in the area - the WindowPrototypes will obscure the menu items. Now that I've written half a novel, here's my question: How do I add the ability for my WindowPrototype objects to be clicked on to bring to the top, but ALSO make sure that the MenuBar items are ALWAYS on top of any/all WindowPrototypes that may be on the screen? Thanks in advance. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: DialogBoxes and MenuBars . . . zIndexing a bad thing?
Well, this is embarrassing, but maybe the answer will help someone else who's run into the same problem. Override the onBrowserEvent() method in my own subclass of DialogBox as follows: @Override public void onBrowserEvent(Event event) { switch(event.getTypeInt()) { case Event.ONMOUSEDOWN: hide(); show(); } super.onBrowserEvent(event); } And that does it, with no ill effects in terms of obscuring the MenuBar objects. Sheesh, I must now hold the record for shortest time between someone posting and answering their own question! -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
MenuBar - how can I cause it to wrap?
All, Ok, playing around with GWT in general, MenuBar right now in particular. I have a situation where a demo app screen I have is more or less looking how I want it to. But, I have an issue with MenuBar, and didn't know if there was a simple way around it. If the user shrinks the screen so that all the menu items in the MenuBar don't fit horizontally, they do NOT wrap as you'd expect in a standard application, but instead simply get cut off. Is there a way to get the MenuBar to wrap its contents if there's not enough horizontal space for them to fit on a single line? The structure of my screen is: RootPanel - DockLayoutPanel - - DockPanel (addStyleName used to give a style that sets width: 100%;) - - - NORTH - MenuBar - - - SOUTH - FlowPanel (addStyleName used to give a style that sets position:absolute; bottom: 0;) Thanks in advance! -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: MenuBar - how can I cause it to wrap?
Uh, let me clarify my structure - what I've described above is more or less accurate, but the DockPanel is specifically the CENTER item of the DockLayoutPanel. Also, I should mention that the individual items will wrap in the menu bar (ie: an item that is called File Menu rather than just File will break the two words into two lines if need be), but the MenuBar tries to force everything to be a single row. Other than that, the rest of my post applies. Sorry for any confusion. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Using DockPLayoutPanel - can I get an autoexpanding south widget?
Danny, Thomas, Thanks for the suggestions. I actually came up with a workaround - though Thomas, I think I like the HeaderPanel idea, and may adapt it to my project instead. What I'm doing currently is: 1) Attach a DockLayoutPanel to the RootPanel 2) Attach a DockPanel to the CENTER of the DockLayoutPanel - DockPanel has the following style added - width: 100% 3) Attach a MenuBar to the NORTH part of the DockPanel 4) Attach a FlowPanel to the SOUTH part of the DockPanel - FlowPanel has the following styles added - position: absolute; bottom: 0; This seems to have done the trick for me. Now if only I could get the MenuBar to wrap if the browser window is too small... but that's something I asked about in a more recent post. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Using DockPLayoutPanel - can I get an autoexpanding south widget?
All, Ok, I realize DockLayoutPanel is a full-screen sort of Panel, that REQUIRES an explicit size for every widget attached. So, given that, I'm wondering if what I want to do is even possible. I'm trying to go for an application-like look. Essentially, the screen will be in three sections: 1) The north section will have a MenuBar - no surprise there. 2) The center section will be the guts of the GUI. 3) The south section will be something like a Windows Taskbar. Right now this is a FlowPanel. The center section will basically have various items in it, and they can be minimized. When this happens, I'd like to add them to the taskbar at the bottom. Now, here's the thing - if a lot items in the main section get minimized, the FlowPanel will get more and more items added to it, and eventually be wider than the screen. Naturally, the FlowPanel would expand under normal circumstances to form a new row - but since its size has been explicitly set, this does not happen. Now, my initial instinct is to somehow try and determine whether or not the FlowPanel needs to vertically resize (how do I determine this? Can it be determined?) and then use DockLayoutPanel.setWidgetSize to perform the resizing manually. Is this possible? Is there a simpler way to get the behavior I want? Thanks. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Ok, CssResources and ClientBundle, what am I doing wrong?
Aw, crap - Aiden even specifically said that, and I missed it. Thanks for pointing it out. Now, don't mind me as I smack my palm against my forehead. Twice. - Joe On Nov 4, 4:35 pm, Danny Kirchmeier da...@kirchmeier.us wrote: Does your Style1.css now say this: @external .gwt-Button; .gwt-Button{ background: black; color: cyan; } Don't forget the semicolon at the end of the @external line. I forgot it the first few times I used it. It causes no error to be thrown and next style to be completely ignored. It worked for me, so hopefully that is your issue. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: DatePicker - different styles for different instances?
Just posting here to bounce this one up - anyone have any idea if what I'm asking is possible? Or am I asking for something that can't be done? On Oct 21, 10:24 am, King_V kin...@mindless.com wrote: All, Ok, I've used DatePicker, NOT with DateBox, to show a calendar and allow selection. No problem. In order to get my own styles for some of the components, my own project's .css has a few of the DatePicker css components in it. First question: What is .gwt-DatePicker used for? What parts of the DatePicker does it apply to? What properties can be set there? Second question: Far more important to me. How do I get different DatePicker looks? I have .datePickerDay, .datePickerWeekendLabel, and a few others in my own .css file. I do NOT have .gwt-DatePicker in it. Most of my DatePickers are just fine, but there are one or two places where I want it to look completely different - different colors, different font sizes for the days in the month, the days of the week across the top, and the month and year name, and so on. How do I add/set styles for these without changing how the other DatePickers look? Thanks in advance. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Ok, CssResources and ClientBundle, what am I doing wrong?
All, I'm getting an exception trying to use CssResources and ClientBundle. Admittedly, I'm completely new to it and don't really quite know what I'm doing. So, can someone explain to me why this doesn't work, and what exactly it is that I'm doing wrong? In any case, here's my code. Both classes exist in the package com.gwttests.client, and the Style1.css file exists in com.gwttests.client.css: class MyClientBundle: package com.gwttests.client; import com.google.gwt.core.client.GWT; import com.google.gwt.resources.client.ClientBundle; import com.google.gwt.resources.client.CssResource; public interface MyClientBundle extends ClientBundle { public final static MyClientBundle INSTANCE = GWT.create(MyClientBundle.class); @Source(css/Style1.css) MyCssResource css(); public static interface MyCssResource extends CssResource { String superSize(); } } class TestClientBundleAndCssResources: package com.gwttests.client; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.RootPanel; public class TestClientBundleAndCssResources implements EntryPoint { static { MyClientBundle.INSTANCE.css().ensureInjected(); } public void onModuleLoad() { RootPanel rootPanel = RootPanel.get(); rootPanel.clear(); Button button1 = new Button(First Button); rootPanel.add(button1); } } Style1.css .gwt-Button { background: black; color: cyan; } .superSize { font-size: 500%; } Everything compiles just fine. When I run in development mode and launch the given URL, I get the following exception: 16:20:58.462 [ERROR] [testclientbundleandcssresources] Unable to load module entry point class com.gwttests.client.TestClientBundleAndCssResources (see associated exception for details) java.lang.RuntimeException: Deferred binding failed for 'com.gwttests.client.MyClientBundle' (did you forget to inherit a required module?) at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:53) at com.google.gwt.core.client.GWT.create(GWT.java:97) at com.gwttests.client.MyClientBundle.lt;clinitgt; (MyClientBundle.java:9) at com.gwttests.client.TestClientBundleAndCssResources.lt;clinitgt; (TestClientBundleAndCssResources.java:10) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:247) at com.google.gwt.dev.shell.ModuleSpace.loadClassFromSourceName(ModuleSpace.java: 654) at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java: 363) at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java: 200) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java: 525) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java: 363) at java.lang.Thread.run(Thread.java:662) Caused by: com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries) at com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java: 595) at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java: 455) at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49) at com.google.gwt.core.client.GWT.create(GWT.java:97) at com.gwttests.client.MyClientBundle.lt;clinitgt; (MyClientBundle.java:9) at com.gwttests.client.TestClientBundleAndCssResources.lt;clinitgt; (TestClientBundleAndCssResources.java:10) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:247) at com.google.gwt.dev.shell.ModuleSpace.loadClassFromSourceName(ModuleSpace.java: 654) at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java: 363) at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java: 200) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java: 525) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java: 363) at java.lang.Thread.run(Thread.java:662) --- -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Ok, CssResources and ClientBundle, what am I doing wrong?
Aidan, Thanks. I'm still really just learning this stuff, so I'll admit to some cluelessness. Your advice took care of the Exception being thrown. However, I've noticed that the Button is ignoring the style. Am I using this technique incorrectly? I also tried adding ! important to the style (specifically for background, at any rate), but no difference. Is there a simple, idiot-level tutorial of using CssResource and ClientBundle? Something about as small and simple as the code I'm (so far unsuccessfully) writing? Thanks. - Joe On Nov 4, 4:49 pm, Aidan O'Kelly aida...@gmail.com wrote: You have .gwt-Button in the .css file, but not in the style interface, hence the compile error. It should be a clearer error (if you stop/start dev mode it will probably give you the correct error, and it certainly will if you GWT-compile the project) In any case, to fix, you need to declare .gwt-Button as '@external' @external gwt-Button; .gwt-Button { } http://code.google.com/webtoolkit/doc/latest/DevGuideClientBundle.htm... Now, you could create an accessor method in the Style interface for gwt-Button, and use setPrimaryStyleName() on the buttons you want it appied to. This way the style would be obfuscated. However when working with the stock GWT widgets, its generally better to use un-obfuscated style names, as currently, the 'dependent style names' system does not work with obfuscation. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
DatePicker - different styles for different instances?
All, Ok, I've used DatePicker, NOT with DateBox, to show a calendar and allow selection. No problem. In order to get my own styles for some of the components, my own project's .css has a few of the DatePicker css components in it. First question: What is .gwt-DatePicker used for? What parts of the DatePicker does it apply to? What properties can be set there? Second question: Far more important to me. How do I get different DatePicker looks? I have .datePickerDay, .datePickerWeekendLabel, and a few others in my own .css file. I do NOT have .gwt-DatePicker in it. Most of my DatePickers are just fine, but there are one or two places where I want it to look completely different - different colors, different font sizes for the days in the month, the days of the week across the top, and the month and year name, and so on. How do I add/set styles for these without changing how the other DatePickers look? Thanks in advance. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.