import elemental.json.JsonObject;
/**
- * XhrConnectionError provides detail about an error which occured during an XHR
- * request to the server.
+ * XhrConnectionError provides detail about an error which occurred during
+ * an XHR request to the server.
*
* @since 7.6
* @author Vaadin Ltd
if (WidgetUtil.isTouchEvent(event) || !resized) {
super.onBrowserEvent(event);
} else if (DOM.eventGetType(event) == Event.ONMOUSEUP) {
- // Reset the resized flag after a mouseup has occured so the next
+ // Reset the resized flag after a mouseup has occurred so the next
// mousedown/mouseup can be interpreted as a click.
resized = false;
}
/**
* Returns the application connection to which this {@link VDropHandler}
- * belongs to. DragAndDropManager uses this fucction to send Transferable to
+ * belongs to. DragAndDropManager uses this function to send Transferable to
* server side.
*/
public ApplicationConnection getApplicationConnection();
/**
* Focusable flow panel which fires focus/blur events if it or any of its child
- * is focused/blured, but doesn't fire events if it happens between its content
+ * is focused/blurred, but doesn't fire events if it happens between its content
* (child) elements.
*
* @author Vaadin Ltd
private class FocusBlurHandler implements BlurHandler, FocusHandler {
- private boolean blurOccured;
+ private boolean blurOccurred;
@Override
public void onBlur(BlurEvent event) {
- blurOccured = true;
+ blurOccurred = true;
Scheduler.get().scheduleDeferred(() -> fireBlurEvent(event));
}
@Override
public void onFocus(FocusEvent event) {
- if (!blurOccured) {
- // no blur occured before this focus event
+ if (!blurOccurred) {
+ // no blur occurred before this focus event
eventBus.fireEvent(event);
} else {
- // blur occured before this focus event
+ // blur occurred before this focus event
// another component inside the panel was
- // blurred => do not fire the focus and set blurOccured to
+ // blurred => do not fire the focus and set blurOccurred to
// false, so
// blur will not be fired, too
- blurOccured = false;
+ blurOccurred = false;
}
}
private void fireBlurEvent(BlurEvent event) {
- if (blurOccured) {
+ if (blurOccurred) {
eventBus.fireEvent(event);
- blurOccured = false;
+ blurOccurred = false;
}
}
}
* optiongroup: if a control inside this optiongroup gains focus right after
* blur of another control inside this optiongroup (meaning: if onFocus
* fires after onBlur has fired), the blur and focus won't be sent to the
- * server side as only a focus change inside this optiongroup occured
+ * server side as only a focus change inside this optiongroup occurred
*/
- private boolean blurOccured = false;
+ private boolean blurOccurred = false;
/** For internal use only. May be removed or replaced in the future. */
public boolean htmlContentAllowed = false;
@Override
public void onFocus(FocusEvent arg0) {
- if (!blurOccured) {
- // no blur occured before this focus event
+ if (!blurOccurred) {
+ // no blur occurred before this focus event
// panel was blurred => fire the event to the server side if
// requested by server side
if (sendFocusEvents) {
client.updateVariable(paintableId, EventId.FOCUS, "", true);
}
} else {
- // blur occured before this focus event
+ // blur occurred before this focus event
// another control inside the panel (checkbox / radio box) was
- // blurred => do not fire the focus and set blurOccured to false, so
+ // blurred => do not fire the focus and set blurOccurred to false,
+ // so
// blur will not be fired, too
- blurOccured = false;
+ blurOccurred = false;
}
}
@Override
public void onBlur(BlurEvent arg0) {
- blurOccured = true;
+ blurOccurred = true;
if (sendBlurEvents) {
Scheduler.get().scheduleDeferred(new Command() {
@Override
public void execute() {
- // check whether blurOccured still is true and then send the
- // event out to the server
- if (blurOccured) {
+ // check whether blurOccurred still is true and then send
+ // the event out to the server
+ if (blurOccurred) {
client.updateVariable(paintableId, EventId.BLUR, "",
true);
- blurOccured = false;
+ blurOccurred = false;
}
}
});
/** For internal use only. May be removed or replaced in the future. */
public void resizeSortedColumnForSortIndicator() {
// Force recalculation of the captionContainer element inside the header
- // cell to accomodate for the size of the sort arrow.
+ // cell to accommodate for the size of the sort arrow.
HeaderCell sortedHeader = tHead.getHeaderCell(sortColumn);
if (sortedHeader != null) {
// Mark header as sorted now. Any earlier marking would lead to
}
if (col.hasAttribute("width") && !c.isResizing) {
- // Make sure to accomodate for the sort indicator if
+ // Make sure to accommodate for the sort indicator if
// necessary.
int width = col.getIntAttribute("width");
int widthWithoutAddedIndent = width;
/**
* Get the description of the event. The description is the text displayed
- * when hoovering over the event with the mouse
+ * when hovering over the event with the mouse
*
* @return
*/
/**
* Set the description of the event. The description is the text displayed
- * when hoovering over the event with the mouse
+ * when hovering over the event with the mouse
*
* @param description
*/
}
}
}
- // remove the root of subtree if children where succesfully removed
+ // remove the root of subtree if children where successfully removed
if (success) {
success = container.removeItem(itemId);
}
public interface SucceededListener extends Serializable {
/**
- * Upload successfull..
+ * Upload successful.
*
* @param event
- * the Upload successfull event.
+ * the Upload successful event.
*/
public void uploadSucceeded(SucceededEvent event);
}
add the rest of the files (.settings, .project, .classpath and target)
to .gitignore with Team -> Ignore. Finally, just do Team -> Commit.
-At this point - or later whenevery you are ready for it - you can
+At this point - or later whenever you are ready for it - you can
publish the project to GitHub. Just go to github.com and create a new
repository. Use MyList as the name for the repository. Then follow the
instructions on the screen. In my case, I executed the following command
changes to server-side code - for example to `WidgetTestApplication.java`
- hit save and reload the browser pointing to
http://localhost:8080/mylist/?restartApplication, the changes are
-appliead immediately. Even better - you can start the project with Debug
+applied immediately. Even better - you can start the project with Debug
As and add break points to the application.
Client-side changes are more tricky as they are compiled from Java to
JavaScript by GWT. To make those changes immediately you, must be
-running a GWT Devepment Mode. This is done by running Maven goal gwt:run
+running a GWT Development Mode. This is done by running Maven goal gwt:run
instead of just pointing your web browser to the running application.
Note that must be running both jetty:run and gwt:run concurrently.
gwt:run starts application called "GWT Development Mode". From there you
The shape, size and layout of these fields don’t really correspond to
the kinds of values expected to be entered in them, or to the relations
between different fields. For instance, while the homepage url is
-probably between 25 and 55 characters long, european postal codes are
+probably between 25 and 55 characters long, European postal codes are
only about 6 digits long, and age maxes out at three digits. By setting
the widths of these fields to be approximately proportional to the
lengths of expected values, the fields become easier to identify, and
themselves which can also contain other components. If you are about to
implement a component that contains other components, then you'll get a
headstart by extending Vaadin's `ComponentContainer`. The biggest feature
-is in tranferring the list of server side components from your component
+is in transferring the list of server side components from your component
to the client. Here's how you do it.
[[server-side]]
applied._
Some of the nice features you get with Sass include variables, selector
-nesting, mixins (optionally with paramaters), selector inheritance. For
+nesting, mixins (optionally with parameters), selector inheritance. For
more information of what you can do with Sass, you should refer to the
official documentation at http://sass-lang.com
nuisance of an error message.
image:img/potus2.png[Save and Revert actions disabled when they cannot be
-succesfully
+successfully
performed.]
[[disablingenabling-actions-to-indicate-state]]
}
....
-And finally similiarly for `Page`. For instance adding a browser window
+And finally similarly for `Page`. For instance adding a browser window
resize listener can be added like this:
[source,java]
....
We'll inject that to the UI and assign the user some name during
-initalization (for now)
+initialization (for now)
[source,java]
....
widget was multilingual text field. It acts just like normal textfield
but when opened, you get the java field opened with multiple locale
instances, it has nice UI too including user friendly flags. Great for
-handling i18n based data in your UI. We got multiple customercases that
+handling i18n based data in your UI. We got multiple customer cases that
enjoy these new widgets. -*Jani Laakso*
===============================
be replaced in the future and also when updating old systems to use
Vaadin (e.g. SWING applications that are written this way) it has been a
breeze when the only thing that needs to be rewritten is the UI. Another
-very imporant factor is security, trust your data layer, do not trust
+very important factor is security, trust your data layer, do not trust
your clients, using enterprise beans with JNDI helps you. Scalability
and high-availability are also easier to cope with. Scale up with
multiple cheap Tomcat machines acting as Vaadin clients, few powerful
The communication that Vaadin's "thin client" in browser does with the
server side has couple of checks that it does to improve robustness and
security. One can simulate these with Gatling as well, by e.g.
-https://github.com/mstahv/v-quiz/blob/master/src/test/scala/loadtest/WebSocketVaadinSimulation.scala#L84[reading the XSRF preventation key into a variable] and passing the value
+https://github.com/mstahv/v-quiz/blob/master/src/test/scala/loadtest/WebSocketVaadinSimulation.scala#L84[reading the XSRF prevention key into a variable] and passing the value
https://github.com/mstahv/v-quiz/blob/master/src/test/scala/loadtest/WebSocketVaadinSimulation.scala#L95[in
each response]. However, these setting can be disabled during load
testing to make it easier to write and maintain your application. The
Disabling XSRF presentation key
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-The XSRF preventation can be disabled with following servlet parameter
+The XSRF prevention can be disabled with following servlet parameter
(or similar servlet 3 style parameter). NOTE, do not leave this for
public apps in production.
Using the recorder in this case doesn't work, but handcrafting the test
case isn't that hard once you get started. The example app has a branch
with WebSocket test case. With WebSocket communication it might also be
-handy to disable xsrf preventation and the so called "syncid".
+handy to disable xsrf prevention and the so called "syncid".
First two request are just normal http requests. The first gets the
"host page" and also the initial state request is done with normal XHR.
Check out this script for
https://github.com/mstahv/v-quiz/blob/master/src/test/scala/loadtest/WebSocketVaadinSimulation.scala[an
-example using WebSocket] communication. It also saves XSRF preventation
+example using WebSocket] communication. It also saves XSRF prevention
key to variable, so it don't need it to be disabled from the server.
[[configuring-gatling-to-the-web-app-build]]
image:img/moduleDesign.jpg[1]
-We want to create a simple UI following the MVC pattern using the IT Mill Toolkit. The project components need to have low coupling and follow an enterprise design. In our example we also want to retrieve information from a database and display it in the view. The different parts of the UI need also to be able to communicate with eachother.
+We want to create a simple UI following the MVC pattern using the IT Mill Toolkit. The project components need to have low coupling and follow an enterprise design. In our example we also want to retrieve information from a database and display it in the view. The different parts of the UI need also to be able to communicate with each other.
We have divided the project in two layers; A UI layer, which purpose is to display information to the user, and a Data layer which has no knowledge of the Toolkit and which is only responsible for retrieving and storing data. The reason for dividing the project up in these layers is so that, if we choose, we can easily use multiple servers.
layouts when possible
* Do you need to extend CustomComponent in your server side composition
or could you just extend some layout? This will result having one
-component less in the component tree. You might sometimes be argueing
-against this because of architectual reasons (CustomComponent has a
+component less in the component tree. You might sometimes be arguing
+against this because of architectural reasons (CustomComponent has a
fewer methods than VerticalLayout), but on the other hand Java has
interfaces to deal the issue in a cleaner manner.
* Maybe you have an extra layout inside your Panel or Window (see
One caveat regarding read-only fields is that if the text is longer than
the field, it will be clipped, as opposed to a Label, which instead will
wrap the text to a new line. Thus, in certain situations, switching to
-Labels may be preferrable.
+Labels may be preferable.
It’s probably best to mention here that *setReadOnly(true)* also has a
certain side-effect in Vaadin that *setEnabled(false)* does not: You
and the client side in Vaadin, with one caveat: Cookies are not possible
if you enable Push using WebSocket (see tickets
http://dev.vaadin.com/ticket/11808[11808] and
-http://dev.vaadin.com/ticket/12518[12518]). Begining in Vaadin 7.6,
+http://dev.vaadin.com/ticket/12518[12518]). Beginning in Vaadin 7.6,
cookies can be used with the WEBSOCKET_XHR transport type.
The
should have access to it.
1. Store the data as a field in your UI subclass. The data is easily
-accesible from components belonging to that UI instance and the data
+accessible from components belonging to that UI instance and the data
will be gone when the UI is closed.
2. Store data in the `VaadinServiceSession`. The data is easily
accessible from any UI belonging to the same VaadinServlet or
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
There are many tools for making icons, and icon fonts. One of our
-favourite tools is http://icomoon.io/app[IcoMoon], which is an excellent
+favorite tools is http://icomoon.io/app[IcoMoon], which is an excellent
online application where you can pick icons from a vast library of
ready-made icon fonts, to compose your own set of icons. When you’re
done, you can download a zip that contains your font files - just copy
4. Mark the icons you want in your font
5. _Download_ the font
-In IcoMoon you can also produce a customised version of FontAwesome, if
+In IcoMoon you can also produce a customized version of FontAwesome, if
you for instance want to remove unused icons, or swap individual icons.
You can also re-upload your custom icon font, if you want to make
changes or additions to it later.Â
com.paulwithers.helloVaadinFeature.
image:img/domino16.png[16]
-27. Click Next and initialise from the com.paulwithers.helloVaadin
+27. Click Next and initialize from the com.paulwithers.helloVaadin
plugin.
28. Select *File* > *New* > *Update Site Project*. Call it
Vaadin 7 is easy to integrate with Spring Security. You should configure only
2 files. First - web.xml and second one spring-security.xml (user
credentials and security settings). This is a small example on how to use
-base form for authentification.
+base form for authentication.
[[web.xml-configuration]]
web.xml Configuration
* *Objects must be injected* and managed by the CDI implementation in
order to use CDI features.
** *Use @Inject on an instance field* to make the CDI implementation
-inject a managed intstance of the corresponding type.
+inject a managed instance of the corresponding type.
** *Annotate your UI class with @CDIUI("")* to let Vaadin CDI know that
it should inject and use instances of that class when the application is
opened in the browser.
+++++++++++++++++++
As we have covered big part of normal work when developing an
-application, created the persistance layer, maybe next questions are
+application, created the persistence layer, maybe next questions are
coming. Where are the data stored? What database is used and how to
change it?
TARGET nullRepresentation) {
return withConverter(
fieldValue -> Objects.equals(fieldValue, nullRepresentation)
- ? null : fieldValue,
+ ? null
+ : fieldValue,
modelValue -> Objects.isNull(modelValue)
- ? nullRepresentation : modelValue);
+ ? nullRepresentation
+ : modelValue);
}
/**
restoreBeanState(bean, oldValues);
} else if (getBean() == null || bean.equals(getBean())) {
/*
- * Changes have been succesfully saved. The set is only cleared
+ * Changes have been successfully saved. The set is only cleared
* if using readBean/writeBean or when the changes are stored in
* the currently set bean.
*
Converter<FIELDVALUE, FIELDVALUE> nullRepresentationConverter = Converter
.from(fieldValue -> fieldValue,
modelValue -> Objects.isNull(modelValue)
- ? field.getEmptyValue() : modelValue,
+ ? field.getEmptyValue()
+ : modelValue,
exception -> exception.getMessage());
ConverterDelegate<FIELDVALUE> converter = new ConverterDelegate<>(
nullRepresentationConverter);
/**
* Checks if the Alt key was down when the mouse event took place.
*
- * @return true if Alt was down when the event occured, false otherwise
+ * @return true if Alt was down when the event occurred, false otherwise
*/
public boolean isAltKey() {
return details.isAltKey();
/**
* Checks if the Ctrl key was down when the mouse event took place.
*
- * @return true if Ctrl was pressed when the event occured, false
+ * @return true if Ctrl was pressed when the event occurred, false
* otherwise
*/
public boolean isCtrlKey() {
/**
* Checks if the Meta key was down when the mouse event took place.
*
- * @return true if Meta was pressed when the event occured, false
+ * @return true if Meta was pressed when the event occurred, false
* otherwise
*/
public boolean isMetaKey() {
/**
* Checks if the Shift key was down when the mouse event took place.
*
- * @return true if Shift was pressed when the event occured, false
+ * @return true if Shift was pressed when the event occurred, false
* otherwise
*/
public boolean isShiftKey() {
public interface SessionExpiredHandler extends RequestHandler {
/**
- * Called when the a session expiration has occured and a notification needs
- * to be sent to the user. If a response is written, this method should
- * return <code>true</code> to indicate that no more
+ * Called when the a session expiration has occurred and a notification
+ * needs to be sent to the user. If a response is written, this method
+ * should return <code>true</code> to indicate that no more
* {@link SessionExpiredHandler} handlers should be invoked for the request.
*
* @param request
ci.getInternalErrorMessage(), null,
ci.getInternalErrorURL()));
} catch (IOException e) {
- // An exception occured while writing the response. Log
+ // An exception occurred while writing the response. Log
// it and continue handling only the original error.
getLogger().log(Level.WARNING,
"Failed to write critical notification response to the client",
* @param reponseString
* The actual response
* @throws IOException
- * If an error occured while writing the response
+ * If an error occurred while writing the response
*/
public void writeStringResponse(VaadinResponse response, String contentType,
String reponseString) throws IOException {
/**
* Checks if the Alt key was down when the mouse event took place.
*
- * @return true if Alt was down when the event occured, false otherwise
+ * @return true if Alt was down when the event occurred, false otherwise
* or if unknown
*/
public boolean isAltKey() {
/**
* Checks if the Ctrl key was down when the mouse event took place.
*
- * @return true if Ctrl was pressed when the event occured, false
+ * @return true if Ctrl was pressed when the event occurred, false
* otherwise or if unknown
*/
public boolean isCtrlKey() {
/**
* Checks if the Meta key was down when the mouse event took place.
*
- * @return true if Meta was pressed when the event occured, false
+ * @return true if Meta was pressed when the event occurred, false
* otherwise or if unknown
*/
public boolean isMetaKey() {
/**
* Checks if the Shift key was down when the mouse event took place.
*
- * @return true if Shift was pressed when the event occured, false
+ * @return true if Shift was pressed when the event occurred, false
* otherwise or if unknown
*/
public boolean isShiftKey() {
public interface SucceededListener extends Serializable {
/**
- * Upload successfull..
+ * Upload successful.
*
* @param event
- * the Upload successfull event.
+ * the Upload successful event.
*/
public void uploadSucceeded(SucceededEvent event);
}
if (i.toLocalDate().getYear() != year) {
break;
}
- long epocHours = Duration
+ long epochHours = Duration
.ofSeconds(t.getInstant().getEpochSecond())
.toHours();
long duration = Math.max(t.getDuration().toMinutes(), 0);
- transitionsList.add(epocHours);
+ transitionsList.add(epochHours);
transitionsList.add(duration);
}
}
}
// report fields that use lambda types that won't be serializable
- // (also in syntehtic classes)
+ // (also in synthetic classes)
Stream.of(cls.getDeclaredFields())
.filter(field -> isFunctionalType(field.getGenericType()))
.forEach(nonSerializableFunctionFields::add);
* Called when drop event happens on client side.
*
* @param types
- * List of data types from {@code DataTransfer.types} object.
+ * List of data types from {@code DataTransfer.types} object.
* @param data
- * Map containing all types and corresponding data from the {@code
+ * Map containing all types and corresponding data from the
+ * {@code
* DataTransfer} object.
* @param dropEffect
- * the desired drop effect
+ * the desired drop effect
* @param rowKey
- * Key of the row on which the drop event occured.
+ * Key of the row on which the drop event occurred.
* @param dropLocation
- * Location of the drop within the row.
+ * Location of the drop within the row.
* @param mouseEventDetails
- * Mouse event details object containing information about the drop
- * event
+ * Mouse event details object containing information about the
+ * drop event
*/
public void drop(List<String> types, Map<String, String> data,
- String dropEffect, String rowKey,
- DropLocation dropLocation, MouseEventDetails mouseEventDetails);
+ String dropEffect, String rowKey, DropLocation dropLocation,
+ MouseEventDetails mouseEventDetails);
}
; Uncomment to limit to certain browsers or override in launch configuration
; browsers=winxp-opera10
-; Claim that the server has started succesfully. Needed for TB2 tests to be executed
+; Claim that the server has started successfully. Needed for TB2 tests to be executed
server.start.succeeded=1
; Directory where temporary Java classes are created
*/
@Override
public void componentEvent(Event event) {
- // Check if event occured at fsTree component
+ // Check if event occurred at fsTree component
if (event.getSource() == menu) {
// Check if event is about changing value
if (event.getClass() == Field.ValueChangeEvent.class) {
}
}
- // just partly mach lowercase
+ // just partly match lowercase
for (Object next : menu.getItemIds()) {
if (next instanceof Class) {
Class<?> c = (Class<?>) next;
final String eventListenerString = "Component.Listener feedback: ";
Label eventListenerFeedback = new Label(
- eventListenerString + " <no events occured>");
+ eventListenerString + " <no events occurred>");
int count = 0;
public TestCaptionWrapper() {
test(layout, button);
button.addListener(this);
- final AbstractDateField<?, ?> df = new TestDateField("DateField " + count++);
+ final AbstractDateField<?, ?> df = new TestDateField(
+ "DateField " + count++);
test(layout, df);
final CheckBox cb = new CheckBox("Checkbox " + count++);
*/
@Override
public void componentEvent(Event event) {
- // Check if event occured at fsTree component
+ // Check if event occurred at fsTree component
if (event.getSource() == filesystem) {
// Check if event is about changing value
if (event.getClass() == Field.ValueChangeEvent.class) {
public class ButtonClick extends AbstractReindeerTestUI {
- public static final String SUCCESS_TEXT = "Click received succesfully!";
+ public static final String SUCCESS_TEXT = "Click received successfully!";
public static final String WRONG_BUTTON_TEXT = "Wrong button clicked.";
@Override
@Override
public void drop(DragAndDropEvent event) {
Transferable transferable = event.getTransferable();
- log("Drop occured");
+ log("Drop occurred");
if (transferable instanceof WrapperTransferable) {
WrapperTransferable wTransferable = (WrapperTransferable) transferable;
Html5File[] files = wTransferable.getFiles();
private void onSingleSelect(SingleSelectionEvent<DataObject> event) {
log("SingleSelectionEvent: Selected: "
+ (event.getSelectedItem().isPresent()
- ? event.getSelectedItem().get().toString() : "none"));
+ ? event.getSelectedItem().get().toString()
+ : "none"));
}
private void onMultiSelect(MultiSelectionEvent<DataObject> event) {
String addedRow = firstAdded.isPresent() ? firstAdded.get().toString()
: "none";
String removedRow = firstRemoved.isPresent()
- ? firstRemoved.get().toString() : "none";
+ ? firstRemoved.get().toString()
+ : "none";
log("SelectionEvent: Added " + addedRow + ", Removed " + removedRow);
}
private Component createMenu() {
MenuBar menu = new MenuBar();
- menu.setErrorHandler(error -> log("Exception occured, "
+ menu.setErrorHandler(error -> log("Exception occurred, "
+ error.getThrowable().getClass().getName() + ": "
+ error.getThrowable().getMessage()));
MenuItem componentMenu = menu.addItem("Component", null);
}
columnsMenu.addItem("Clear sort", item -> grid.clearSortOrder());
- columnsMenu.addItem("Simple resize mode",
- item -> grid.setColumnResizeMode(item.isChecked()
- ? ColumnResizeMode.SIMPLE : ColumnResizeMode.ANIMATED))
+ columnsMenu
+ .addItem("Simple resize mode",
+ item -> grid.setColumnResizeMode(
+ item.isChecked() ? ColumnResizeMode.SIMPLE
+ : ColumnResizeMode.ANIMATED))
.setCheckable(true);
}
? t -> "Row tooltip for row " + t.getRowNumber()
: null))
.setCheckable(true);
- stateMenu
- .addItem("Cell description generator", item -> grid.getColumns()
- .stream().findFirst()
- .ifPresent(c -> c.setDescriptionGenerator(
- item.isChecked() ? t -> "Cell tooltip for row "
+ stateMenu.addItem("Cell description generator",
+ item -> grid.getColumns().stream().findFirst().ifPresent(
+ c -> c.setDescriptionGenerator(item.isChecked()
+ ? t -> "Cell tooltip for row "
+ t.getRowNumber() + ", Column 0"
- : null)))
+ : null)))
.setCheckable(true);
stateMenu.addItem("Item click listener", new Command() {
rootLayout.addComponent(bottom);
// The splitpanel is by default 100% x 100%, but we'll need to adjust
- // our main window layout to accomodate the height
+ // our main window layout to accommodate the height
rootLayout.setExpandRatio(bottom, 1.0F);
// Give the sidebar less space than the listing
new NativeSelect());
// Lets populate the table with random data
- String[] tracks = { "Red Flag", "Millstone", "Not The Sun",
- "Breath", "Here We Are", "Deep Heaven", "Her Voice Resides",
+ String[] tracks = { "Red Flag", "Millstone", "Not The Sun", "Breath",
+ "Here We Are", "Deep Heaven", "Her Voice Resides",
"Natural Tan", "End It All", "Kings", "Daylight Slaving",
"Mad Man", "Resolve", "Teargas", "African Air",
"Passing Bird" };
- String[] times = { "4:12", "6:03", "5:43", "4:32", "3:42",
- "4:45", "2:56", "9:34", "2:10", "3:44", "5:49", "6:30", "5:18",
- "7:42", "3:13", "2:52" };
- String[] artists = { "Billy Talent", "Brand New",
- "Breaking Benjamin", "Becoming The Archetype",
- "Bullet For My Valentine", "Chasing Victory", "Chimaira",
- "Danko Jones", "Deadlock", "Deftones", "From Autumn To Ashes",
- "Haste The Day", "Four Year Strong", "In Flames", "Kemopetrol",
- "John Legend" };
+ String[] times = { "4:12", "6:03", "5:43", "4:32", "3:42", "4:45",
+ "2:56", "9:34", "2:10", "3:44", "5:49", "6:30", "5:18", "7:42",
+ "3:13", "2:52" };
+ String[] artists = { "Billy Talent", "Brand New", "Breaking Benjamin",
+ "Becoming The Archetype", "Bullet For My Valentine",
+ "Chasing Victory", "Chimaira", "Danko Jones", "Deadlock",
+ "Deftones", "From Autumn To Ashes", "Haste The Day",
+ "Four Year Strong", "In Flames", "Kemopetrol", "John Legend" };
String[] albums = { "Once Again", "The Caitiff Choir",
"The Devil And God", "Light Grenades", "Dicthonomy",
"Back In Black", "Dreamer", "Come Clarity", "Year Zero",
"Frames", "Fortress", "Phobia", "The Poison", "Manifesto",
"White Pony", "The Big Dirty" };
- String[] genres = { "Rock", "Metal", "Hardcore", "Indie",
- "Pop", "Alternative", "Blues", "Jazz", "Hip Hop", "Electronica",
+ String[] genres = { "Rock", "Metal", "Hardcore", "Indie", "Pop",
+ "Alternative", "Blues", "Jazz", "Hip Hop", "Electronica",
"Punk", "Hard Rock", "Dance", "R'n'B", "Gospel", "Country" };
for (int i = 0; i < 1000; i++) {
NativeSelect s = new NativeSelect();
private Component createMenu() {
MenuBar menu = new MenuBar();
- menu.setErrorHandler(error -> log("Exception occured, "
+ menu.setErrorHandler(error -> log("Exception occurred, "
+ error.getThrowable().getClass().getName() + ": "
+ error.getThrowable().getMessage()));
MenuItem componentMenu = menu.addItem("Component", null);
componentMenu
.addItem("Style Generator",
menuItem -> tree.setStyleGenerator(menuItem.isChecked()
- ? t -> "level" + t.getDepth() : t -> null))
+ ? t -> "level" + t.getDepth()
+ : t -> null))
.setCheckable(true);
return menu;
selectionBox.click();
selectionBox.click();
- assertFalse("Exception occured on row reselection.", logContainsText(
- "Exception occured, java.lang.IllegalStateException: No item id for key 101 found."));
+ assertFalse("Exception occurred on row reselection.", logContainsText(
+ "Exception occurred, java.lang.IllegalStateException: No item id for key 101 found."));
}
@Test
assertFalse(
"Unexpected NullPointerException when removing selected rows",
logContainsText(
- "Exception occured, java.lang.NullPointerException: null"));
+ "Exception occurred, java.lang.NullPointerException: null"));
}
@Test
private void makeInvalidEdition() {
editRow(5);
assertFalse(logContainsText(
- "Exception occured, java.lang.IllegalStateException"));
+ "Exception occurred, java.lang.IllegalStateException"));
GridEditorElement editor = getGridElement().getEditor();
public class GridEditorUnbufferedTest extends GridEditorTest {
- private static final String[] TOGGLE_EDITOR_BUFFERED = {
- "Component", "Editor", "Buffered mode" };
- private static final String[] CANCEL_EDIT = { "Component",
- "Editor", "Cancel edit" };
+ private static final String[] TOGGLE_EDITOR_BUFFERED = { "Component",
+ "Editor", "Buffered mode" };
+ private static final String[] CANCEL_EDIT = { "Component", "Editor",
+ "Cancel edit" };
@Override
@Before
assertEditorOpen();
selectMenuPath(TOGGLE_EDITOR_BUFFERED);
boolean thrown = logContainsText(
- "Exception occured, java.lang.IllegalStateException");
+ "Exception occurred, java.lang.IllegalStateException");
assertTrue("IllegalStateException was not thrown", thrown);
}
@Test
@Ignore
public void memoryTest() throws IOException {
- // Set breakoint and look memory consuption in Profiler
+ // Set breakpoint and look memory consumption in Profiler
// Mozilla Firefox doesn't provide memory usage profiler, use chrome.
openTestURL();
}
btnDel.click();
}
- // Set breakoint and look memory consuption in Profiler
+ // Set breakpoint and look memory consumption in Profiler
btnAdd = $(ButtonElement.class).get(0);
}
private void makeInvalidEdition() {
selectMenuPath(EDIT_ITEM_5);
assertFalse(logContainsText(
- "Exception occured, java.lang.IllegalStateException"));
+ "Exception occurred, java.lang.IllegalStateException"));
GridEditorElement editor = getGridElement().getEditor();
selectMenuPath(EDIT_ITEM_100);
boolean thrown = logContainsText(
- "Exception occured, java.lang.IllegalStateException");
+ "Exception occurred, java.lang.IllegalStateException");
assertTrue("IllegalStateException thrown", thrown);
assertEditorOpen();
.className("v-grid-editor-cancel");
protected static final By BY_EDITOR_SAVE = By
.className("v-grid-editor-save");
- protected static final String[] EDIT_ITEM_5 = { "Component",
- "Editor", "Edit item 5" };
- protected static final String[] EDIT_ITEM_100 = { "Component",
- "Editor", "Edit item 100" };
- protected static final String[] TOGGLE_EDIT_ENABLED = {
- "Component", "Editor", "Enabled" };
+ protected static final String[] EDIT_ITEM_5 = { "Component", "Editor",
+ "Edit item 5" };
+ protected static final String[] EDIT_ITEM_100 = { "Component", "Editor",
+ "Edit item 100" };
+ protected static final String[] TOGGLE_EDIT_ENABLED = { "Component",
+ "Editor", "Enabled" };
@Before
public void setUp() {
selectMenuPath(EDIT_ITEM_5);
assertEditorClosed();
boolean thrown = logContainsText(
- "Exception occured, java.lang.IllegalStateException");
+ "Exception occurred, java.lang.IllegalStateException");
assertTrue("IllegalStateException thrown", thrown);
}
selectMenuPath(TOGGLE_EDIT_ENABLED);
assertEditorOpen();
boolean thrown = logContainsText(
- "Exception occured, java.lang.IllegalStateException");
+ "Exception occurred, java.lang.IllegalStateException");
assertTrue("IllegalStateException thrown", thrown);
}
public class GridEditorUnbufferedTest extends GridEditorTest {
- private static final String[] TOGGLE_EDITOR_BUFFERED = {
- "Component", "Editor", "Buffered mode" };
- private static final String[] CANCEL_EDIT = { "Component",
- "Editor", "Cancel edit" };
+ private static final String[] TOGGLE_EDITOR_BUFFERED = { "Component",
+ "Editor", "Buffered mode" };
+ private static final String[] CANCEL_EDIT = { "Component", "Editor",
+ "Cancel edit" };
@Override
@Before
assertEditorOpen();
selectMenuPath(TOGGLE_EDITOR_BUFFERED);
boolean thrown = logContainsText(
- "Exception occured, java.lang.IllegalStateException");
+ "Exception occurred, java.lang.IllegalStateException");
assertTrue("IllegalStateException thrown", thrown);
}
public void testAddThirdRowToGrid() {
openTestURL();
selectMenuPath("Component", "Body rows", "Add third row");
- assertFalse(logContainsText("Exception occured"));
+ assertFalse(logContainsText("Exception occurred"));
}
@Test