Permalink
Browse files

SWITCHYARD-1152 update as7 console to 1.4.0.Final

  • Loading branch information...
1 parent 0a7550a commit 449331f4809450294d6bf9f45f07061f2db6b23f @rcernich rcernich committed Dec 3, 2012
View
@@ -50,6 +50,12 @@
<scope>provided</scope>
</dependency>
<dependency>
+ <groupId>org.jboss.as</groupId>
+ <artifactId>console-spi</artifactId>
+ <classifier>sources</classifier>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
@@ -19,7 +19,6 @@
<module rename-to="app">
- <inherits name="org.jboss.as.console.App" />
<inherits name="org.switchyard.console.SwitchYard" />
<set-configuration-property name="gin.ginjector"
@@ -18,7 +18,7 @@
*/
package org.switchyard.console.application.client;
-import org.jboss.as.console.client.core.gin.CoreUI;
+import org.jboss.as.console.client.core.gin.Composite;
import org.switchyard.console.client.gin.SwitchYardGinjector;
/**
@@ -29,6 +29,6 @@
*
* @author Rob Cernich
*/
-public interface AggregatedConsoleGinjector extends CoreUI, SwitchYardGinjector {
+public interface AggregatedConsoleGinjector extends Composite, SwitchYardGinjector {
}
@@ -18,7 +18,7 @@
*/
package org.switchyard.console.application.client;
-import org.jboss.as.console.client.core.gin.CoreUI;
+import org.jboss.as.console.client.core.gin.Composite;
import org.jboss.as.console.client.core.gin.GinjectorSingleton;
import com.google.gwt.core.client.GWT;
@@ -32,10 +32,10 @@
*/
public class AggregatedConsoleSingleton implements GinjectorSingleton {
- private static final CoreUI INSTANCE = GWT.create(AggregatedConsoleGinjector.class);
+ private static final Composite INSTANCE = GWT.create(AggregatedConsoleGinjector.class);
@Override
- public CoreUI getCoreUI() {
+ public Composite getCoreUI() {
return INSTANCE;
}
View
@@ -37,6 +37,10 @@
</properties>
<dependencies>
<dependency>
+ <groupId>org.jboss.as</groupId>
+ <artifactId>console-spi</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.jboss.ballroom</groupId>
<artifactId>widgets</artifactId>
</dependency>
@@ -101,7 +105,7 @@
<version>${version.jbossas.console}</version>
<classifier>sources</classifier>
<type>jar</type>
- <excludes>org/jboss/as/console/client/Console.java,org/jboss/as/console/client/shared/SubsystemMetaData.java,org/jboss/as/console/client/domain/runtime/DomainRuntimeNavigation.java,org/jboss/as/console/client/standalone/runtime/StandaloneRuntimeNavigation.java,org/jboss/dmr/client/DataInput.java,org/jboss/dmr/client/IEEE754.java,org/jboss/as/console/client/shared/runtime/plain/PlainColumnView.java,META-INF/*.SF,META-INF/*.RSA,META-INF/*.DSA</excludes>
+ <excludes>org/jboss/as/console/client/Console.java,org/jboss/as/console/client/shared/SubsystemMetaData.java,org/jboss/as/console/client/domain/runtime/DomainRuntimeNavigation.java,org/jboss/as/console/client/standalone/runtime/StandaloneRuntimeNavigation.java,org/jboss/dmr/client/DataInput.java,org/jboss/dmr/client/IEEE754.java,org/jboss/as/console/client/shared/runtime/plain/PlainColumnView.java,META-INF/*.SF,META-INF/*.RSA,META-INF/*.DSA,apt/**</excludes>
<outputDirectory>${asConsoleIncludesDirectory}/java</outputDirectory>
</artifactItem>
</artifactItems>
@@ -24,14 +24,16 @@
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.RunAsyncCallback;
import com.google.gwt.core.client.Scheduler;
+import com.google.gwt.event.shared.EventBus;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.RootLayoutPanel;
import com.google.gwt.user.client.ui.Widget;
import com.gwtplatform.mvp.client.DelayedBindRegistry;
+import com.gwtplatform.mvp.client.proxy.PlaceManager;
+import org.jboss.as.console.client.core.BootstrapContext;
import org.jboss.as.console.client.core.LoadingPanel;
import org.jboss.as.console.client.core.UIConstants;
import org.jboss.as.console.client.core.UIDebugConstants;
@@ -41,13 +43,16 @@
import org.jboss.as.console.client.core.bootstrap.EagerLoadProfiles;
import org.jboss.as.console.client.core.bootstrap.ExecutionMode;
import org.jboss.as.console.client.core.bootstrap.LoadMainApp;
+import org.jboss.as.console.client.core.bootstrap.RegisterSubsystems;
import org.jboss.as.console.client.core.bootstrap.RemoveLoadingPanel;
-import org.jboss.as.console.client.core.gin.CoreUI;
+import org.jboss.as.console.client.core.gin.Composite;
import org.jboss.as.console.client.core.gin.GinjectorSingleton;
import org.jboss.as.console.client.core.message.Message;
+import org.jboss.as.console.client.core.message.MessageCenter;
+import org.jboss.as.console.client.plugins.SubsystemRegistry;
+import org.jboss.as.console.client.shared.help.HelpSystem;
import java.util.EnumSet;
-
/**
* Main application entry point.
* Executes a two phased init process:
@@ -60,15 +65,11 @@
*/
public class Console implements EntryPoint {
- /** The MODULES. */
- public final static CoreUI MODULES = GWT.<GinjectorSingleton>create(GinjectorSingleton.class).getCoreUI();
- /** The CONSTANTS. */
+ public final static Composite MODULES = GWT.<GinjectorSingleton>create(GinjectorSingleton.class).getCoreUI();
public final static UIConstants CONSTANTS = GWT.create(UIConstants.class);
- /** The MESSAGES. */
public final static UIDebugConstants DEBUG_CONSTANTS = GWT.create(UIDebugConstants.class);
public final static UIMessages MESSAGES = GWT.create(UIMessages.class);
- @Override
public void onModuleLoad() {
// Defer all application initialisation code to onModuleLoad2() so that the
// UncaughtExceptionHandler can catch any unexpected exceptions.
@@ -82,10 +83,11 @@ public void execute() {
});
}
- /**
- */
public void onModuleLoad2() {
+ // load console css bundle
+ ConsoleResources.INSTANCE.css().ensureInjected();
+
// display the loading panel
final Widget loadingPanel = new LoadingPanel().asWidget();
RootLayoutPanel.get().add(loadingPanel);
@@ -99,11 +101,12 @@ public void onSuccess() {
DelayedBindRegistry.bind(MODULES);
// ordered bootstrap
- BootstrapProcess bootstrap = new BootstrapProcess();
+ final BootstrapProcess bootstrap = new BootstrapProcess();
bootstrap.addHook(new ExecutionMode(MODULES.getBootstrapContext(), MODULES.getDispatchAsync()));
+ bootstrap.addHook(new RegisterSubsystems(MODULES.getSubsystemRegistry()));
bootstrap.addHook(new ChoseProcessor(MODULES.getBootstrapContext()));
- bootstrap.addHook(new EagerLoadProfiles());
+ bootstrap.addHook(new EagerLoadProfiles(MODULES.getProfileStore(), MODULES.getCurrentSelectedProfile()));
bootstrap.addHook(new RemoveLoadingPanel(loadingPanel));
bootstrap.addHook(new LoadMainApp(MODULES.getBootstrapContext(), MODULES.getPlaceManager(), MODULES.getTokenFormatter()));
@@ -123,7 +126,11 @@ public void onSuccess(Boolean wasSuccessfull) {
// currently we only deal with authentication errors
RootLayoutPanel.get().remove(loadingPanel);
- HTMLPanel explanation = new HTMLPanel("<center><div style='padding-top:150px;'>The web console could not be loaded. Please refresh this page to start over.</div></center>");
+ String cause = "";
+ if(MODULES.getBootstrapContext().getLastError()!=null)
+ cause = MODULES.getBootstrapContext().getLastError().getMessage();
+
+ HTMLPanel explanation = new HTMLPanel("<center><div style='padding-top:150px;'><h2>The web console could not be loaded.</h2>"+cause+"</div></center>");
RootLayoutPanel.get().add(explanation);
}
@@ -134,82 +141,53 @@ public void onSuccess(Boolean wasSuccessfull) {
});
}
- /**
- * @param message the message
- */
public static void info(String message) {
- MODULES.getMessageCenter().notify(
+ getMessageCenter().notify(
new Message(message, Message.Severity.Info)
);
}
- /**
- * @param message the message
- */
public static void error(String message) {
- MODULES.getMessageCenter().notify(
+ getMessageCenter().notify(
new Message(message, Message.Severity.Error)
);
}
- /**
- * @param message the message
- * @param detail details
- */
public static void error(String message, String detail) {
- MODULES.getMessageCenter().notify(
+ getMessageCenter().notify(
new Message(message, detail, Message.Severity.Error)
);
}
- /**
- * @param message the message
- */
public static void warning(String message) {
- MODULES.getMessageCenter().notify(
+ getMessageCenter().notify(
new Message(message, Message.Severity.Warning)
);
}
- /**
- * @param message the message
- * @param sticky is it sticky
- */
public static void warning(String message, boolean sticky) {
Message msg = sticky ?
new Message(message, Message.Severity.Warning, EnumSet.of(Message.Option.Sticky)) :
new Message(message, Message.Severity.Warning);
- MODULES.getMessageCenter().notify(msg);
+ getMessageCenter().notify(msg);
}
- /**
- * @param message the message
- * @param detail details
- * @param sticky is it sticky
- */
public static void warning(String message, String detail, boolean sticky) {
Message msg = sticky ?
new Message(message, detail, Message.Severity.Warning, EnumSet.of(Message.Option.Sticky)) :
new Message(message, detail, Message.Severity.Warning);
- MODULES.getMessageCenter().notify(msg);
+ getMessageCenter().notify(msg);
}
- /**
- * @param message the message
- * @param detail details
- */
public static void warning(String message, String detail) {
- MODULES.getMessageCenter().notify(
+ getMessageCenter().notify(
new Message(message, detail, Message.Severity.Warning)
);
}
- /**
- * @param cmd the command
- */
public static void schedule(final Command cmd)
{
Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
@@ -220,14 +198,38 @@ public void execute() {
});
}
- /**
- * @return true if vis api is loaded.
- */
+ public static EventBus getEventBus() {
+ return MODULES.getEventBus();
+ }
+
+ public static MessageCenter getMessageCenter() {
+ return MODULES.getMessageCenter();
+ }
+
+ public static PlaceManager getPlaceManager() {
+ return MODULES.getPlaceManager();
+ }
+
+ public static BootstrapContext getBootstrapContext()
+ {
+ return MODULES.getBootstrapContext();
+ }
+
+ public static HelpSystem getHelpSystem() {
+ return MODULES.getHelpSystem();
+ }
+
+
+ @Deprecated
public static native boolean visAPILoaded() /*-{
-if ($wnd['google'] && $wnd.google['load']) {
-return true;
-}
-return false;
-}-*/;
+ if ($wnd['google'] && $wnd.google['load']) {
+ return true;
+ }
+ return false;
+ }-*/;
+
+ public static SubsystemRegistry getSubsystemRegistry() {
+ return MODULES.getSubsystemRegistry();
+ }
}
@@ -30,10 +30,10 @@
*/
public class CoreUISingleton implements GinjectorSingleton {
- private static final CoreUI INSTANCE = GWT.create(CoreUI.class);
+ private static final Composite INSTANCE = GWT.create(Composite.class);
@Override
- public CoreUI getCoreUI() {
+ public Composite getCoreUI() {
return INSTANCE;
}
@@ -47,5 +47,5 @@
/**
* @return the CoreUI Ginjector.
*/
- CoreUI getCoreUI();
+ Composite getCoreUI();
}
Oops, something went wrong.

0 comments on commit 449331f

Please sign in to comment.