Skip to content

Commit

Permalink
Fixed about 600 warns.
Browse files Browse the repository at this point in the history
  • Loading branch information
Acarus committed Sep 29, 2016
1 parent 926b41c commit fc65aac
Show file tree
Hide file tree
Showing 63 changed files with 1,411 additions and 857 deletions.
Expand Up @@ -34,6 +34,8 @@
import com.google.gwt.user.client.ui.RootLayoutPanel; import com.google.gwt.user.client.ui.RootLayoutPanel;
import com.google.web.bindery.event.shared.EventBus; import com.google.web.bindery.event.shared.EventBus;


import jline.internal.Log;

import org.kaaproject.kaa.common.dto.KaaAuthorityDto; import org.kaaproject.kaa.common.dto.KaaAuthorityDto;
import org.kaaproject.kaa.common.dto.admin.AuthResultDto; import org.kaaproject.kaa.common.dto.admin.AuthResultDto;
import org.kaaproject.kaa.common.dto.admin.AuthResultDto.Result; import org.kaaproject.kaa.common.dto.admin.AuthResultDto.Result;
Expand Down Expand Up @@ -89,7 +91,8 @@ public static boolean isDevMode() {
} }


public static void signOut() { public static void signOut() {
RequestBuilder builder = new RequestBuilder(RequestBuilder.POST, GWT.getModuleBaseURL() + "j_spring_security_logout"); RequestBuilder builder = new RequestBuilder(
RequestBuilder.POST, GWT.getModuleBaseURL() + "j_spring_security_logout");
try { try {
builder.sendRequest(null, new RequestCallback() { builder.sendRequest(null, new RequestCallback() {
@Override @Override
Expand All @@ -103,7 +106,8 @@ public void onError(Request request, Throwable exception) {
redirectToModule(".."); redirectToModule("..");
} }
}); });
} catch (RequestException e) { } catch (RequestException ex) {
GWT.log("Exception: " + ex.getMessage());
} }
} }


Expand Down Expand Up @@ -154,14 +158,14 @@ private void init() {


dataSource = new DataSource(eventBus); dataSource = new DataSource(eventBus);


PlaceController placeController = clientFactory.getPlaceController();

ActivityMapper headerActivityMapper = new HeaderActivityMapper(clientFactory); ActivityMapper headerActivityMapper = new HeaderActivityMapper(clientFactory);
ActivityManager headerActivityManager = new ActivityManager(headerActivityMapper, eventBus); ActivityManager headerActivityManager = new ActivityManager(headerActivityMapper, eventBus);
headerActivityManager.setDisplay(appWidget.getAppHeaderHolder()); headerActivityManager.setDisplay(appWidget.getAppHeaderHolder());


ActivityMapper navigationActivityMapper = new NavigationActivityMapper(clientFactory, eventBus); ActivityMapper navigationActivityMapper = new NavigationActivityMapper(
ActivityManager navigationActivityManager = new ActivityManager(navigationActivityMapper, eventBus); clientFactory, eventBus);
ActivityManager navigationActivityManager = new ActivityManager(
navigationActivityMapper, eventBus);
navigationActivityManager.setDisplay(appWidget.getNavContentHolder()); navigationActivityManager.setDisplay(appWidget.getNavContentHolder());


ActivityMapper appActivityMapper = new AppActivityMapper(clientFactory); ActivityMapper appActivityMapper = new AppActivityMapper(clientFactory);
Expand All @@ -186,7 +190,8 @@ private void init() {
historyMapper = GWT.create(TenantUserPlaceHistoryMapper.class); historyMapper = GWT.create(TenantUserPlaceHistoryMapper.class);
clientFactory.setHomePlace(new ApplicationsPlace()); clientFactory.setHomePlace(new ApplicationsPlace());
break; break;

default:
break;
} }


PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(historyMapper); PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(historyMapper);
Expand All @@ -198,6 +203,7 @@ private void init() {
place = new ApplicationsPlace(); place = new ApplicationsPlace();
} }


PlaceController placeController = clientFactory.getPlaceController();
historyHandler.register(placeController, eventBus, place); historyHandler.register(placeController, eventBus, place);


RootLayoutPanel.get().add(appWidget); RootLayoutPanel.get().add(appWidget);
Expand Down
Expand Up @@ -54,8 +54,8 @@ public CustomDeckLayoutPanel() {
} }


@Override @Override
public void add(Widget w) { public void add(Widget widget) {
insert(w, getWidgetCount()); insert(widget, getWidgetCount());
} }


@Override @Override
Expand Down Expand Up @@ -114,8 +114,8 @@ public int getVisibleWidgetIndex() {
} }


@Override @Override
public void insert(IsWidget w, int beforeIndex) { public void insert(IsWidget widget, int beforeIndex) {
insert(asWidgetOrNull(w), beforeIndex); insert(asWidgetOrNull(widget), beforeIndex);
} }


@Override @Override
Expand Down Expand Up @@ -190,20 +190,20 @@ public void onResize() {
} }


@Override @Override
public boolean remove(Widget w) { public boolean remove(Widget widget) {
boolean removed = super.remove(w); boolean removed = super.remove(widget);
if (removed) { if (removed) {
Layer layer = (Layer) w.getLayoutData(); Layer layer = (Layer) widget.getLayoutData();
layout.removeChild(layer); layout.removeChild(layer);
w.setLayoutData(null); widget.setLayoutData(null);


if (visibleWidget == w) { if (visibleWidget == widget) {
visibleWidget = null; visibleWidget = null;
} }
if (hidingWidget == w) { if (hidingWidget == widget) {
hidingWidget = null; hidingWidget = null;
} }
if (lastVisibleWidget == w) { if (lastVisibleWidget == widget) {
lastVisibleWidget = null; lastVisibleWidget = null;
} }
} }
Expand All @@ -215,23 +215,23 @@ public boolean remove(Widget w) {
* is added to the end of the panel. If the specified widget is null, the * is added to the end of the panel. If the specified widget is null, the
* currently-visible widget will be hidden. * currently-visible widget will be hidden.
* *
* @param w the widget to show, and add if not a child * @param widget the widget to show, and add if not a child
*/ */
@Override @Override
public void setWidget(IsWidget w) { public void setWidget(IsWidget widget) {
// Hide the currently visible widget. // Hide the currently visible widget.
if (w == null) { if (widget == null) {
showWidget(null); showWidget(null);
return; return;
} }


// Add the widget if it is not already a child. // Add the widget if it is not already a child.
if (w.asWidget().getParent() != this) { if (widget.asWidget().getParent() != this) {
add(w); add(widget);
} }


// Show the widget. // Show the widget.
showWidget(w.asWidget()); showWidget(widget.asWidget());
} }


/** /**
Expand Down Expand Up @@ -294,7 +294,8 @@ protected void onDetach() {
* @param widget the widget to check * @param widget the widget to check
*/ */
void assertIsChild(Widget widget) { void assertIsChild(Widget widget) {
assert (widget == null) || (widget.getParent() == this) : "The specified widget is not a child of this panel"; assert (widget == null)
|| (widget.getParent() == this) : "The specified widget is not a child of this panel";
} }


/** /**
Expand Down Expand Up @@ -322,8 +323,8 @@ private void doBeforeLayout() {
int oldIndex = getWidgetIndex(lastVisibleWidget); int oldIndex = getWidgetIndex(lastVisibleWidget);
int newIndex = getWidgetIndex(visibleWidget); int newIndex = getWidgetIndex(visibleWidget);
double direction = (oldIndex < newIndex) ? 100.0 : -100.0; double direction = (oldIndex < newIndex) ? 100.0 : -100.0;
double vDirection = isAnimationVertical ? direction : 0.0; double vertDirection = isAnimationVertical ? direction : 0.0;
double hDirection = isAnimationVertical ? 0.0 double horizDirection = isAnimationVertical ? 0.0
: LocaleInfo.getCurrentLocale().isRTL() ? -direction : direction; : LocaleInfo.getCurrentLocale().isRTL() ? -direction : direction;


/* /*
Expand All @@ -342,8 +343,8 @@ private void doBeforeLayout() {
} }
if (newLayer != null) { if (newLayer != null) {
// The new layer starts off to one side. // The new layer starts off to one side.
newLayer.setTopHeight(vDirection, Unit.PCT, 100.0, Unit.PCT); newLayer.setTopHeight(vertDirection, Unit.PCT, 100.0, Unit.PCT);
newLayer.setLeftWidth(hDirection, Unit.PCT, 100.0, Unit.PCT); newLayer.setLeftWidth(horizDirection, Unit.PCT, 100.0, Unit.PCT);
setWidgetVisible(visibleWidget, newLayer, true); setWidgetVisible(visibleWidget, newLayer, true);
} }
layout.layout(); layout.layout();
Expand All @@ -353,8 +354,8 @@ private void doBeforeLayout() {
// Set the end positions of the layers. // Set the end positions of the layers.
if (oldLayer != null) { if (oldLayer != null) {
// The old layer ends off to one side. // The old layer ends off to one side.
oldLayer.setTopHeight(-vDirection, Unit.PCT, 100.0, Unit.PCT); oldLayer.setTopHeight(-vertDirection, Unit.PCT, 100.0, Unit.PCT);
oldLayer.setLeftWidth(-hDirection, Unit.PCT, 100.0, Unit.PCT); oldLayer.setLeftWidth(-horizDirection, Unit.PCT, 100.0, Unit.PCT);
setWidgetVisible(lastVisibleWidget, oldLayer, true); setWidgetVisible(lastVisibleWidget, oldLayer, true);
} }
if (newLayer != null) { if (newLayer != null) {
Expand All @@ -373,14 +374,14 @@ private void doBeforeLayout() {
lastVisibleWidget = visibleWidget; lastVisibleWidget = visibleWidget;
} }


private void setWidgetVisible(Widget w, Layer layer, boolean visible) { private void setWidgetVisible(Widget widget, Layer layer, boolean visible) {
layer.setVisible(visible); layer.setVisible(visible);


/* /*
* Set the visibility of the widget. This is used by lazy panel to * Set the visibility of the widget. This is used by lazy panel to
* initialize the widget. * initialize the widget.
*/ */
w.setVisible(visible); widget.setVisible(visible);
} }


/** /**
Expand Down
Expand Up @@ -26,26 +26,26 @@ public class SimpleWidgetPanel extends LayoutPanel implements AcceptsOneWidget {
private Widget widget; private Widget widget;


@Override @Override
public void setWidget(IsWidget w) { public void setWidget(IsWidget widget) {
setOneWidget(asWidgetOrNull(w)); setOneWidget(asWidgetOrNull(widget));
} }


private void setOneWidget(Widget w) { private void setOneWidget(Widget widget) {
// validate // validate
if (w == widget) { if (widget == this.widget) {
return; return;
} }


// remove the old widget // remove the old widget
if (widget != null) { if (this.widget != null) {
super.remove(widget); super.remove(this.widget);
} }


// logical attach // logical attach
widget = w; this.widget = widget;


if (w != null) { if (widget != null) {
super.add(w); super.add(widget);
} }
forceLayout(); forceLayout();
} }
Expand Down
Expand Up @@ -65,20 +65,21 @@ public LoginView() {


initWidget(uiBinder.createAndBindUi(this)); initWidget(uiBinder.createAndBindUi(this));


loginTitle.getElement().setInnerSafeHtml(SafeHtmlUtils.fromSafeConstant(Utils.messages.loginTitle())); loginTitle.getElement().setInnerSafeHtml(
SafeHtmlUtils.fromSafeConstant(Utils.messages.loginTitle()));


Label loginLabel = new Label(Utils.constants.username());
usernameBox = new TextBox(); usernameBox = new TextBox();
usernameBox.setName("j_username"); usernameBox.setName("j_username");
usernameBox.setWidth("100%"); usernameBox.setWidth("100%");


Label passwordLabel = new Label(Utils.constants.password());
passwordBox = new PasswordTextBox(); passwordBox = new PasswordTextBox();
passwordBox.setName("j_password"); passwordBox.setName("j_password");
passwordBox.setWidth("100%"); passwordBox.setWidth("100%");


Label loginLabel = new Label(Utils.constants.username());
loginTable.setWidget(0, 0, loginLabel); loginTable.setWidget(0, 0, loginLabel);
loginTable.setWidget(0, 1, usernameBox); loginTable.setWidget(0, 1, usernameBox);
Label passwordLabel = new Label(Utils.constants.password());
loginTable.setWidget(1, 0, passwordLabel); loginTable.setWidget(1, 0, passwordLabel);
loginTable.setWidget(1, 1, passwordBox); loginTable.setWidget(1, 1, passwordBox);


Expand All @@ -87,10 +88,14 @@ public LoginView() {
loginTable.setWidget(2, 0, forgotPasswordLabel); loginTable.setWidget(2, 0, forgotPasswordLabel);


loginTable.getFlexCellFormatter().setWidth(0, 0, "130px"); loginTable.getFlexCellFormatter().setWidth(0, 0, "130px");
loginTable.getFlexCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_RIGHT); loginTable.getFlexCellFormatter()
loginTable.getFlexCellFormatter().setHorizontalAlignment(1, 0, HasHorizontalAlignment.ALIGN_RIGHT); .setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_RIGHT);
loginTable.getFlexCellFormatter().setHorizontalAlignment(2, 0, HasHorizontalAlignment.ALIGN_RIGHT); loginTable.getFlexCellFormatter()
loginTable.getFlexCellFormatter().setColSpan(2, 0, 2); .setHorizontalAlignment(1, 0, HasHorizontalAlignment.ALIGN_RIGHT);
loginTable.getFlexCellFormatter()
.setHorizontalAlignment(2, 0, HasHorizontalAlignment.ALIGN_RIGHT);
loginTable.getFlexCellFormatter()
.setColSpan(2, 0, 2);


loginButton = new Button(Utils.constants.login()); loginButton = new Button(Utils.constants.login());
loginButton.addStyleName(Utils.kaaAdminStyle.loginButton()); loginButton.addStyleName(Utils.kaaAdminStyle.loginButton());
Expand Down
Expand Up @@ -135,9 +135,12 @@ public class ClientFactoryImpl implements ClientFactory {
private final TenantView createTenantView = new TenantViewImpl(true); private final TenantView createTenantView = new TenantViewImpl(true);
private final TenantView tenantView = new TenantViewImpl(false); private final TenantView tenantView = new TenantViewImpl(false);


private final BaseListView<ApplicationDto> applicationsView = new ApplicationsViewImpl(KaaAdmin.checkAuthorities(KaaAuthorityDto.TENANT_ADMIN)); private final BaseListView<ApplicationDto> applicationsView =
private final ApplicationView createApplicationView = new ApplicationViewImpl(true, KaaAdmin.checkAuthorities(KaaAuthorityDto.TENANT_ADMIN)); new ApplicationsViewImpl(KaaAdmin.checkAuthorities(KaaAuthorityDto.TENANT_ADMIN));
private final ApplicationView applicationView = new ApplicationViewImpl(false, KaaAdmin.checkAuthorities(KaaAuthorityDto.TENANT_ADMIN)); private final ApplicationView createApplicationView =
new ApplicationViewImpl(true, KaaAdmin.checkAuthorities(KaaAuthorityDto.TENANT_ADMIN));
private final ApplicationView applicationView =
new ApplicationViewImpl(false, KaaAdmin.checkAuthorities(KaaAuthorityDto.TENANT_ADMIN));


private final BaseListView<SdkProfileDto> sdkProfilesView = new SdkProfilesViewImpl(); private final BaseListView<SdkProfileDto> sdkProfilesView = new SdkProfilesViewImpl();
private final SdkProfileView sdkProfileView = new SdkProfileViewImpl(); private final SdkProfileView sdkProfileView = new SdkProfileViewImpl();
Expand All @@ -147,21 +150,33 @@ public class ClientFactoryImpl implements ClientFactory {
private final UserView createUserView = new UserViewImpl(true); private final UserView createUserView = new UserViewImpl(true);
private final UserView userView = new UserViewImpl(false); private final UserView userView = new UserViewImpl(false);


private final BaseListView<EndpointProfileSchemaDto> profileSchemasView = new ProfileSchemasViewImpl(); private final BaseListView<EndpointProfileSchemaDto> profileSchemasView =
private final BaseCtlSchemaView profileSchemaView = new ProfileSchemaViewImpl(false); new ProfileSchemasViewImpl();
private final BaseCtlSchemaView createProfileSchemaView = new ProfileSchemaViewImpl(true); private final BaseCtlSchemaView profileSchemaView =

new ProfileSchemaViewImpl(false);
private final BaseListView<ServerProfileSchemaDto> serverProfileSchemasView = new ServerProfileSchemasViewImpl(); private final BaseCtlSchemaView createProfileSchemaView =
private final BaseCtlSchemaView serverProfileSchemaView = new ServerProfileSchemaViewImpl(false); new ProfileSchemaViewImpl(true);
private final BaseCtlSchemaView createServerProfileSchemaView = new ServerProfileSchemaViewImpl(true);

private final BaseListView<ServerProfileSchemaDto> serverProfileSchemasView =
private final BaseListView<ConfigurationSchemaDto> configurationSchemasView = new ConfigurationSchemasViewImpl(); new ServerProfileSchemasViewImpl();
private final BaseCtlSchemaView configurationSchemaView = new ConfigurationSchemaViewImpl(false); private final BaseCtlSchemaView serverProfileSchemaView =
private final BaseCtlSchemaView createConfigurationSchemaView = new ConfigurationSchemaViewImpl(true); new ServerProfileSchemaViewImpl(false);

private final BaseCtlSchemaView createServerProfileSchemaView =
private final BaseListView<NotificationSchemaDto> notificationSchemasView = new NotificationSchemasViewImpl(); new ServerProfileSchemaViewImpl(true);
private final BaseCtlSchemaView notificationSchemaView = new NotificationSchemaViewImpl(false);
private final BaseCtlSchemaView createNotificationSchemaView = new NotificationSchemaViewImpl(true); private final BaseListView<ConfigurationSchemaDto> configurationSchemasView =
new ConfigurationSchemasViewImpl();
private final BaseCtlSchemaView configurationSchemaView =
new ConfigurationSchemaViewImpl(false);
private final BaseCtlSchemaView createConfigurationSchemaView =
new ConfigurationSchemaViewImpl(true);

private final BaseListView<NotificationSchemaDto> notificationSchemasView =
new NotificationSchemasViewImpl();
private final BaseCtlSchemaView notificationSchemaView =
new NotificationSchemaViewImpl(false);
private final BaseCtlSchemaView createNotificationSchemaView =
new NotificationSchemaViewImpl(true);


private final BaseListView<LogSchemaDto> logSchemasView = new LogSchemasViewImpl(); private final BaseListView<LogSchemaDto> logSchemasView = new LogSchemasViewImpl();
private final BaseCtlSchemaView logSchemaView = new LogSchemaViewImpl(false); private final BaseCtlSchemaView logSchemaView = new LogSchemaViewImpl(false);
Expand Down Expand Up @@ -217,7 +232,8 @@ public class ClientFactoryImpl implements ClientFactory {


private final CtlSchemaView createCtlSchemaView = new CtlSchemaViewImpl(true, true); private final CtlSchemaView createCtlSchemaView = new CtlSchemaViewImpl(true, true);
private final CtlSchemaView editCtlSchemaView = new CtlSchemaViewImpl(false, true); private final CtlSchemaView editCtlSchemaView = new CtlSchemaViewImpl(false, true);
private final CtlSchemaView editApplicationCtlSchemaView = new ApplicationCtlSchemaViewImpl(false, true); private final CtlSchemaView editApplicationCtlSchemaView =
new ApplicationCtlSchemaViewImpl(false, true);
private final CtlSchemaView viewCtlSchemaView = new CtlSchemaViewImpl(false, false); private final CtlSchemaView viewCtlSchemaView = new CtlSchemaViewImpl(false, false);


private Place homePlace; private Place homePlace;
Expand Down
Expand Up @@ -398,7 +398,7 @@ public void onSuccessImpl(CtlSchemaFormDto result) {
} else if (place.getSchemaType() == SchemaType.EVENT_CLASS && place.getPreviousPlace() != null) { } else if (place.getSchemaType() == SchemaType.EVENT_CLASS && place.getPreviousPlace() != null) {
EventClassPlace eventClassPlace = new EventClassPlace(place.getEcfId(), place.getEcfVersionId(), place.getEcfVersion(), ""); EventClassPlace eventClassPlace = new EventClassPlace(place.getEcfId(), place.getEcfVersionId(), place.getEcfVersion(), "");
eventClassPlace.setCtlSchemaId(ctlSchemaID); eventClassPlace.setCtlSchemaId(ctlSchemaID);
eventClassPlace.setNameEC(nameEC); eventClassPlace.setNameEc(nameEC);
goTo(eventClassPlace); goTo(eventClassPlace);
} }
} else if (place.getPreviousPlace() != null) { } else if (place.getPreviousPlace() != null) {
Expand Down
Expand Up @@ -182,7 +182,7 @@ public void onFailure(Throwable caught) {
@Override @Override
public void onSuccess(CtlSchemaReferenceDto ctlSchemaReferenceDto) { public void onSuccess(CtlSchemaReferenceDto ctlSchemaReferenceDto) {
detailsView.getCtlSchemaReference().setValue(ctlSchemaReferenceDto); detailsView.getCtlSchemaReference().setValue(ctlSchemaReferenceDto);
detailsView.getName().setValue(place.getNameEC()); detailsView.getName().setValue(place.getNameEc());
place.setCtlSchemaId(null); place.setCtlSchemaId(null);
} }
}); });
Expand Down
Expand Up @@ -64,7 +64,8 @@ public boolean equals(Object obj) {
return true; return true;
} }


public static abstract class Tokenizer<P extends AbstractPluginPlace> implements PlaceTokenizer<P>, PlaceConstants { public abstract static class Tokenizer<P extends AbstractPluginPlace>
implements PlaceTokenizer<P>, PlaceConstants {


@Override @Override
public P getPlace(String token) { public P getPlace(String token) {
Expand Down
Expand Up @@ -68,7 +68,8 @@ public TreePlaceDataProvider getDataProvider(EventBus eventBus) {
return null; return null;
} }


public static abstract class Tokenizer<P extends AbstractPluginsPlace> implements PlaceTokenizer<P>, PlaceConstants { public static abstract class Tokenizer<P extends AbstractPluginsPlace>
implements PlaceTokenizer<P>, PlaceConstants {


@Override @Override
public P getPlace(String token) { public P getPlace(String token) {
Expand Down

0 comments on commit fc65aac

Please sign in to comment.