Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update links to source code, fix heading levels #365

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ private String getEditUrl(String path) {
}

int index = path.indexOf(SEPARATOR + "src" + SEPARATOR);
return "<a class=\"icon_editGithub\" href=\"https://github.com/gwtproject/gwt-site/edit/master/"
return "<a class=\"icon_editGithub\" href=\"https://github.com/gwtproject/gwt-site/edit/main/"
+ path.substring(index + 1).replace(SEPARATOR, "/") + "\"></a>";
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/markdown/community-group-charter.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h2>Welcome to the GWT Discussion Group!</h2>
# Welcome to the GWT Discussion Group!

The GWT (GWT) allows developers to use the Java programming language to build no-compromise AJAX applications. This is the official discussion forum for GWT.

Expand Down
2 changes: 1 addition & 1 deletion src/main/markdown/doc/latest/DevGuideClientBundle.md
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ background-position: left 4px top 10px;
ImageResource logo();
```

* [Current auto-RTL test cases](https://gwt.googlesource.com/gwt/+/master/user/test/com/google/gwt/resources/rg)
* [Current auto-RTL test cases](https://github.com/gwtproject/gwt/blob/main/user/test/com/google/gwt/resources/rg)

#### Selector obfuscation<a id="Selector_obfuscation"></a>

Expand Down
12 changes: 6 additions & 6 deletions src/main/markdown/doc/latest/DevGuideCodingBasicsDeferred.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ rules are pulled into the module build through `<inherits>` elements.
For example, the following configuration invokes deferred binding for the [PopupPanel](/javadoc/latest/com/google/gwt/user/client/ui/PopupPanel.html) widget:

* Top level `<module>.gwt.xml` _**inherits**_
[com.google.gwt.user.User](https://gwt.googlesource.com/gwt/+/master/user/src/com/google/gwt/user/User.gwt.xml)
* [com/google/gwt/user/User.gwt.xml](https://gwt.googlesource.com/gwt/+/master/user/src/com/google/gwt/user/User.gwt.xml) _**inherits**_ [com.google.gwt.user.Popup](https://gwt.googlesource.com/gwt/+/master/user/src/com/google/gwt/user/Popup.gwt.xml)
* [com/google/gwt/user/Popup.gwt.xml](https://gwt.googlesource.com/gwt/+/master/user/src/com/google/gwt/user/Popup.gwt.xml) _**contains**_ `<replace-with>` elements to define deferred binding rules for the [PopupPanel](/javadoc/latest/com/google/gwt/user/client/ui/PopupPanel.html) class.
[com.google.gwt.user.User](https://github.com/gwtproject/gwt/blob/main/user/src/com/google/gwt/user/User.gwt.xml)
* [com/google/gwt/user/User.gwt.xml](https://github.com/gwtproject/gwt/blob/main/user/src/com/google/gwt/user/User.gwt.xml) _**inherits**_ [com.google.gwt.user.Popup](https://github.com/gwtproject/gwt/blob/main/user/src/com/google/gwt/user/Popup.gwt.xml)
* [com/google/gwt/user/Popup.gwt.xml](https://github.com/gwtproject/gwt/blob/main/user/src/com/google/gwt/user/Popup.gwt.xml) _**contains**_ `<replace-with>` elements to define deferred binding rules for the [PopupPanel](/javadoc/latest/com/google/gwt/user/client/ui/PopupPanel.html) class.

Inside the [PopupPanel](/javadoc/latest/com/google/gwt/user/client/ui/PopupPanel.html) module XML file, there
happens to be some rules defined for deferred binding. In this case, we're using a replacement rule.
Expand Down Expand Up @@ -151,9 +151,9 @@ client will download based on its browser environment.
The following is an example of how a deferred binding generator is specified to the compiler in the [module XML file](DevGuideOrganizingProjects.html#DevGuideModuleXml)
hierarchy for the `RemoteService` class - used for GWT-RPC:

* Top level `<module>.gwt.xml` _**inherits**_ [com.google.gwt.user.User](https://gwt.googlesource.com/gwt/+/master/user/src/com/google/gwt/user/User.gwt.xml)
* [com/google/gwt/user/User.gwt.xml](https://gwt.googlesource.com/gwt/+/master/user/src/com/google/gwt/user/User.gwt.xml) _**inherits**_ [com.googl.gwt.user.RemoteService](https://gwt.googlesource.com/gwt/+/master/user/src/com/google/gwt/user/RemoteService.gwt.xml)
* [com/google/gwt/user/RemoteService.gwt.xml](https://gwt.googlesource.com/gwt/+/master/user/src/com/google/gwt/user/RemoteService.gwt.xml) _**contains**_ `<generates-with>` elements to define deferred binding rules for the `RemoteService` class.
* Top level `<module>.gwt.xml` _**inherits**_ [com.google.gwt.user.User](https://github.com/gwtproject/gwt/blob/main/user/src/com/google/gwt/user/User.gwt.xml)
* [com/google/gwt/user/User.gwt.xml](https://github.com/gwtproject/gwt/blob/main/user/src/com/google/gwt/user/User.gwt.xml) _**inherits**_ [com.googl.gwt.user.RemoteService](https://github.com/gwtproject/gwt/blob/main/user/src/com/google/gwt/user/RemoteService.gwt.xml)
* [com/google/gwt/user/RemoteService.gwt.xml](https://github.com/gwtproject/gwt/blob/main/user/src/com/google/gwt/user/RemoteService.gwt.xml) _**contains**_ `<generates-with>` elements to define deferred binding rules for the `RemoteService` class.

## Generator Configuration in Module XML<a id="generator"></a>

Expand Down
4 changes: 2 additions & 2 deletions src/main/markdown/doc/latest/DevGuideI18nLocale.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ or specifying `locale=` as a query string. In this case, you could write your ow

A property provider is specified in the [module XML file](DevGuideOrganizingProjects.html#DevGuideModuleXml) as a JavaScript fragment that will return the value for the
named property at runtime. In this case, you would want to define the locale property using a property provider. To see examples of `<property-provider>` definitions
in action, see the files [I18N.gwt.xml](https://gwt.googlesource.com/gwt/+/master/user/src/com/google/gwt/i18n/I18N.gwt.xml) and
[UserAgent.gwt.xml](https://gwt.googlesource.com/gwt/+/master/user/src/com/google/gwt/user/UserAgent.gwt.xml) in the GWT source code.
in action, see the files [I18N.gwt.xml](https://github.com/gwtproject/gwt/blob/main/user/src/com/google/gwt/i18n/I18N.gwt.xml) and
[UserAgent.gwt.xml](https://github.com/gwtproject/gwt/blob/main/user/src/com/google/gwt/user/UserAgent.gwt.xml) in the GWT source code.

## Programmatic Access to Locale Information<a id="LocaleInfo"></a>

Expand Down
2 changes: 1 addition & 1 deletion src/main/markdown/doc/latest/DevGuideI18nPluralForms.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ value in a properties file.

See the next item for another use of Exact Values.

## Offsets<a id="Offsets"><a>
## Offsets<a id="Offsets"></a>

In some cases, you may want to alter the count before applying the plural
rules to it. For example, if you are saying `"Bob, Joe, and 3 others ate
Expand Down
2 changes: 1 addition & 1 deletion src/main/markdown/doc/latest/DevGuideLinkers.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Linkers<a id="DevGuideLinkers-intro"></a>
# Linkers<a id="DevGuideLinkers-intro"></a>

The Linker subsystem takes care of writing the GWT compiler's output. It's responsible for each output file's name, location, and content.

Expand Down
24 changes: 12 additions & 12 deletions src/main/markdown/doc/latest/DevGuideLogging.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,30 +43,30 @@ You build and run LogExample the same way you would build and run any of the oth

[![Logging Example web page](images/LoggingExample.png)](images/LoggingExample.png)

LogExample is configured using [`LogExample.gwt.xml`](https://gwt.googlesource.com/gwt/+/master/samples/logexample/src/com/google/gwt/sample/logexample/LogExample.gwt.xml).
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Links are dead since gwtproject/gwt@54908f2

The entry point for the app is [`LogExample.java`](https://gwt.googlesource.com/gwt/+/master/samples/logexample/src/com/google/gwt/sample/logexample/client/LogExample.java) &mdash; it simply creates and adds the various demo modules to the page. Each of these modules illustrates a different set of logging concepts; this tutorial will walk you through them.
LogExample is configured using [`LogExample.gwt.xml`](https://github.com/gwtproject/gwt/blob/3c49dc1b8ac1116d3436e87637c1daeb107d7ea3/samples/logexample/src/com/google/gwt/sample/logexample/LogExample.gwt.xml).
The entry point for the app is [`LogExample.java`](https://github.com/gwtproject/gwt/blob/3c49dc1b8ac1116d3436e87637c1daeb107d7ea3/samples/logexample/src/com/google/gwt/sample/logexample/client/LogExample.java) &mdash; it simply creates and adds the various demo modules to the page. Each of these modules illustrates a different set of logging concepts; this tutorial will walk you through them.

## Loggers, Handlers and the Root Logger<a id="Loggers_Handlers_and_the_Root_Logger"></a>

Loggers are organized in a tree structure, with the Root Logger at the root of the tree. Parent/Child relationships are determined by the name of the logger, using "." to separate sections of the name. So if we have two loggers Foo.Bar and Foo.Baz, then they are siblings, with their parent being the logger named Foo. The Foo logger (and any logger with a name which does not contain a dot ".") has the Root Logger as a parent.

When you log a message to a logger, if the Level of the message is high enough, it will pass the message on to its parent, which will pass it on to its parent, and so on, until the Root Logger is reached. Along the way, any given logger (including the Root Logger) will also pass the message to any of its Handlers, and if the Level of the message is high enough, those handlers will output the message in some way (to a popup, to stderr, etc.). For a much more detailed explanation of this, see [http://java.sun.com/j2se/1.4.2/docs/guide/util/logging/overview.html](http://java.sun.com/j2se/1.4.2/docs/guide/util/logging/overview.html).

If you open [`LogExample.java`](https://gwt.googlesource.com/gwt/+/master/samples/logexample/src/com/google/gwt/sample/logexample/client/LogExample.java) you can see that we've created 3 loggers:
If you open [`LogExample.java`](https://github.com/gwtproject/gwt/blob/3c49dc1b8ac1116d3436e87637c1daeb107d7ea3/samples/logexample/src/com/google/gwt/sample/logexample/client/LogExample.java) you can see that we've created 3 loggers:

```
// <a href="https://gwt.googlesource.com/gwt/+/master/samples/logexample/src/com/google/gwt/sample/logexample/client/LogExample.java">LogExample.java</a>
// <a href="https://github.com/gwtproject/gwt/blob/3c49dc1b8ac1116d3436e87637c1daeb107d7ea3/samples/logexample/src/com/google/gwt/sample/logexample/client/LogExample.java">LogExample.java</a>

private static Logger childLogger = Logger.getLogger("ParentLogger.Child");
private static Logger parentLogger = Logger.getLogger("ParentLogger");
private static Logger rootLogger = Logger.getLogger("");
```

We've passed these 3 loggers into [`LoggerController`](https://gwt.googlesource.com/gwt/+/master/samples/logexample/src/com/google/gwt/sample/logexample/client/LoggerController.java), which in turn, creates an instance of
[`OneLoggerController`](https://gwt.googlesource.com/gwt/+/master/samples/logexample/src/com/google/gwt/sample/logexample/client/OneLoggerController.java) for each of them. In `OneLoggerController.java` you can see example code for changing the Level of the logger, logging to the logger, and logging an exception to the logger.
We've passed these 3 loggers into [`LoggerController`](https://github.com/gwtproject/gwt/blob/3c49dc1b8ac1116d3436e87637c1daeb107d7ea3/samples/logexample/src/com/google/gwt/sample/logexample/client/LoggerController.java), which in turn, creates an instance of
[`OneLoggerController`](https://github.com/gwtproject/gwt/blob/3c49dc1b8ac1116d3436e87637c1daeb107d7ea3/samples/logexample/src/com/google/gwt/sample/logexample/client/OneLoggerController.java) for each of them. In `OneLoggerController.java` you can see example code for changing the Level of the logger, logging to the logger, and logging an exception to the logger.

```
// <a href="https://gwt.googlesource.com/gwt/+/master/samples/logexample/src/com/google/gwt/sample/logexample/client/OneLoggerController.java">OneLoggerController</a>
// <a href="https://github.com/gwtproject/gwt/blob/3c49dc1b8ac1116d3436e87637c1daeb107d7ea3/samples/logexample/src/com/google/gwt/sample/logexample/client/OneLoggerController.java">OneLoggerController</a>

// Change the level of the logger
@UiHandler("levelTextBox")
Expand Down Expand Up @@ -125,7 +125,7 @@ GWT logging comes with a set of Handlers already defined and (by default) attach
Here's an example of how a checkbox adds or removes a handler:

```
// <a href="https://gwt.googlesource.com/gwt/+/master/samples/logexample/src/com/google/gwt/sample/logexample/client/HandlerController.java">HandlerController.java</a>
// <a href="https://github.com/gwtproject/gwt/blob/3c49dc1b8ac1116d3436e87637c1daeb107d7ea3/samples/logexample/src/com/google/gwt/sample/logexample/client/HandlerController.java">HandlerController.java</a>

public void onValueChange(ValueChangeEvent<Boolean> event) {
if (checkbox.getValue()) {
Expand Down Expand Up @@ -158,7 +158,7 @@ Once we have one of these widgets, we simply pass it into the constructor
of a `HasWidgetsLogHandler` and add that Handler to a logger.

```
// <a href="https://gwt.googlesource.com/gwt/+/master/user/src/com/google/gwt/user/client/ui/VerticalPanel.java">VerticalPanel.java</a>
// <a href="https://github.com/gwtproject/gwt/blob/3c49dc1b8ac1116d3436e87637c1daeb107d7ea3/user/src/com/google/gwt/user/client/ui/VerticalPanel.java">VerticalPanel.java</a>

VerticalPanel customLogArea;

Expand All @@ -175,14 +175,14 @@ Although GWT emulates java.util.logging, it is important to understand the diffe

To make this clear, the client-side GWT code has a Root Logger (and logger hierarchy) that is separate from the server-side code; all of the handlers discussed above are only applicable to client-side code. If code shared by the client and server makes logging calls, then which Root Logger (and logger hierarchy) it logs to will depend on whether it is being executed on the client or server side. You should not add or manipulate Handlers in shared code, since this will not work as expected.

In [`ServerLoggingArea.java`](https://gwt.googlesource.com/gwt/+/master/samples/logexample/src/com/google/gwt/sample/logexample/client/ServerLoggingArea.java), you can experiment with these concepts. The buttons in that section will trigger logging calls on the server, as well as logging calls in [`SharedClass.java`](https://gwt.googlesource.com/gwt/+/master/samples/logexample/src/com/google/gwt/sample/logexample/shared/SharedClass.java) from both the client and server side. Note the slight differences in formatting between client-side and server-side logging, as well as the different handlers each is logged to (in the tutorial, server-side logging will simply log to stderr, while client-side logging will log to all of the Handlers discussed above).
In [`ServerLoggingArea.java`](https://github.com/gwtproject/gwt/blob/3c49dc1b8ac1116d3436e87637c1daeb107d7ea3/samples/logexample/src/com/google/gwt/sample/logexample/client/ServerLoggingArea.java), you can experiment with these concepts. The buttons in that section will trigger logging calls on the server, as well as logging calls in [`SharedClass.java`](https://github.com/gwtproject/gwt/blob/3c49dc1b8ac1116d3436e87637c1daeb107d7ea3/samples/logexample/src/com/google/gwt/sample/logexample/shared/SharedClass.java) from both the client and server side. Note the slight differences in formatting between client-side and server-side logging, as well as the different handlers each is logged to (in the tutorial, server-side logging will simply log to stderr, while client-side logging will log to all of the Handlers discussed above).

## Remote Logging<a id="Remote_Logging"></a>

In order for events that are logged by client-side code to be stored on the server side, you need to use a `RemoteLogHandler`. This handler will send log messages to the server, where they will be logged using the server-side logging mechanism. GWT currently contains a `SimpleRemoteLogHandler` which will do this in the simplest possible way (using GWT-RPC) and no intelligent batching, exponential backoffs in case of failure, and so forth. This logger is disabled by default, but you can enable it in the .gwt.xml file (see the section on Handlers above for more details on configuring the default Handlers).

```
# <a href="https://gwt.googlesource.com/gwt/+/master/samples/logexample/src/com/google/gwt/sample/logexample/LogExample.gwt.xml">LogExample.gwt.xml</a>
# <a href="https://github.com/gwtproject/gwt/blob/3c49dc1b8ac1116d3436e87637c1daeb107d7ea3/samples/logexample/src/com/google/gwt/sample/logexample/LogExample.gwt.xml">LogExample.gwt.xml</a>

<set-property name="gwt.logging.simpleRemoteHandler" value="ENABLED" />
```
Expand All @@ -204,7 +204,7 @@ Code that normally compiles out will still be present in Development mode. You

```

// <a href="https://gwt.googlesource.com/gwt/+/master/samples/logexample/src/com/google/gwt/sample/logexample/client/CustomLogArea.java">VerticalPanel.java</a>
// <a href="https://github.com/gwtproject/gwt/blob/3c49dc1b8ac1116d3436e87637c1daeb107d7ea3/samples/logexample/src/com/google/gwt/sample/logexample/client/CustomLogArea.java">VerticalPanel.java</a>

// Although this code will compile out without this check in web mode, the guard will ensure
// that the handler does not show up in development mode.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ Specify the implementation class in .gwt.xml:

You can use `<when-property-is>` to specify different
implementations based on user.agent, locale, or other properties you
define. The [mobilewebapp](https://gwt.googlesource.com/gwt/+/master/samples/mobilewebapp/)
define. The [mobilewebapp](https://github.com/gwtproject/gwt/blob/main/samples/mobilewebapp/)
sample application defines a "formfactor" property used to
select a different view implementations for mobile, tablet, and desktop devices.

Expand Down
69 changes: 41 additions & 28 deletions src/main/markdown/doc/latest/DevGuideRequestFactory.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,50 +60,63 @@ entity can be persisted to a data store such as a relational database or the
Google App Engine Datastore. In persistence frameworks like JDO and JPA,
entities are annotated with @Entity. RequestFactory does not require the use of
any particular framework or annotations on your domain classes. Here's part of
an entity definition from the [Expenses
sample application](https://gwt.googlesource.com/gwt/+/master/samples/expenses) found in the GWT distribution.
an entity definition from the [Mobile
web application](https://github.com/gwtproject/gwt/blob/main/samples/mobilewebapp) found in the GWT distribution.

```
package com.google.gwt.sample.expenses.server.domain;
package com.google.gwt.sample.mobilewebapp.server.domain;

/**
* The Employee domain object.
* A task used in the task list.
*/
@Entity
public class Employee {
public class Task {

@Size(min = 3, max = 30)
private String userName;

private String department;
@Id
Long id;

@NotNull
private String displayName;
private Date dueDate;

private String password;
@NotNull(message = "You must specify a name")
@Size(min = 3, message = "Name must be at least 3 characters long")
private String name;

@JoinColumn
private Long supervisorKey;
private String notes;

@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
/**
* The unique ID of the user who owns this task.
*/
@Index
private String userId;

@Version
@Column(name = "version")
private Integer version;
/**
* Get the due date of the Task.
*/
public Date getDueDate() {
return dueDate;
}

@Transient
private Employee supervisor;
/**
* Get the unique ID of the Task.
*/
public Long getId() {
return id;
}

public String getDepartment() {
return department;
/**
* Get the name of the Task.
*/
public String getName() {
return name;
}

public String getDisplayName() {
return this.displayName;
/**
* Get the notes associated with the task.
*/
public String getNotes() {
return notes;
}

...
}
```
Expand Down Expand Up @@ -684,7 +697,7 @@ any method invocation will result in changes being sent to the server.

Changes to related entities can be persisted in a single request.
For example, this code from the
[DynatableRF sample app](https://gwt.googlesource.com/gwt/+/master/samples/dynatablerf) in GWT trunk creates a new Person and Address at the same time:
[DynatableRF sample app](https://github.com/gwtproject/gwt/tree/main/samples/dynatablerf) in GWT trunk creates a new Person and Address at the same time:

```
PersonRequest context = requestFactory.personRequest();
Expand Down
2 changes: 2 additions & 0 deletions src/main/markdown/doc/latest/DevGuideUiBinder.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# UIBinder

This document explains how to build Widget and DOM structures from XML markup using UiBinder, introduced with GWT 2.0. It does not cover binder's localization features&mdash;read about them in <a href="DevGuideUiBinderI18n.html">Internationalization - UiBinder</a>.

1. [Overview](#Overview)
Expand Down
Loading