-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4f0d8f8
commit 65299ce
Showing
14 changed files
with
110 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,17 @@ | ||
/* | ||
* Copyright 2012 Red Hat, Inc. and/or its affiliates. | ||
* Copyright 2013 Red Hat, Inc. and/or its affiliates. | ||
* | ||
* Licensed under the Eclipse Public License version 1.0, available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
|
||
package org.jboss.forge.ui; | ||
|
||
/** | ||
* @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a> | ||
*/ | ||
public abstract class Result | ||
public interface Result | ||
{ | ||
public String getMessage(); | ||
|
||
private final Class<? extends UICommand> command; | ||
private final String message; | ||
|
||
public static final Result success() | ||
{ | ||
return new ResultSuccess((String) null); | ||
} | ||
|
||
public static final Result success(String message) | ||
{ | ||
return new ResultSuccess(message); | ||
} | ||
|
||
public static final Result success(Class<? extends UICommand> command) | ||
{ | ||
return new ResultSuccess(command); | ||
} | ||
|
||
public static final Result success(Class<? extends UICommand> next, String message) | ||
{ | ||
return new ResultSuccess(message); | ||
} | ||
|
||
public static final Result fail(String message) | ||
{ | ||
return new ResultFail(message); | ||
} | ||
|
||
public static final Result fail(Class<? extends UICommand> command) | ||
{ | ||
return new ResultFail(command); | ||
} | ||
|
||
public static final Result fail(Class<? extends UICommand> next, String message) | ||
{ | ||
return new ResultFail(message); | ||
} | ||
|
||
Result(String message) | ||
{ | ||
this.message = message; | ||
this.command = null; | ||
} | ||
|
||
Result(Class<? extends UICommand> command) | ||
{ | ||
this.message = null; | ||
this.command = command; | ||
} | ||
|
||
Result(Class<? extends UICommand> command, String message) | ||
{ | ||
this.command = command; | ||
this.message = message; | ||
} | ||
|
||
public String getMessage() | ||
{ | ||
return this.message; | ||
} | ||
|
||
public Class<? extends UICommand> getCommand() | ||
{ | ||
return this.command; | ||
} | ||
} | ||
public Class<? extends UICommand> getCommand(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/* | ||
* Copyright 2012 Red Hat, Inc. and/or its affiliates. | ||
* | ||
* Licensed under the Eclipse Public License version 1.0, available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
|
||
package org.jboss.forge.ui; | ||
|
||
/** | ||
* @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a> | ||
*/ | ||
public abstract class Results implements Result | ||
{ | ||
private final Class<? extends UICommand> command; | ||
private final String message; | ||
|
||
public static final Results success() | ||
{ | ||
return new ResultSuccess((String) null); | ||
} | ||
|
||
public static final Results success(String message) | ||
{ | ||
return new ResultSuccess(message); | ||
} | ||
|
||
public static final Results success(Class<? extends UICommand> command) | ||
{ | ||
return new ResultSuccess(command); | ||
} | ||
|
||
public static final Results success(Class<? extends UICommand> next, String message) | ||
{ | ||
return new ResultSuccess(message); | ||
} | ||
|
||
public static final Results fail(String message) | ||
{ | ||
return new ResultFail(message); | ||
} | ||
|
||
public static final Results fail(Class<? extends UICommand> command) | ||
{ | ||
return new ResultFail(command); | ||
} | ||
|
||
public static final Results fail(Class<? extends UICommand> next, String message) | ||
{ | ||
return new ResultFail(message); | ||
} | ||
|
||
Results(String message) | ||
{ | ||
this.message = message; | ||
this.command = null; | ||
} | ||
|
||
Results(Class<? extends UICommand> command) | ||
{ | ||
this.message = null; | ||
this.command = command; | ||
} | ||
|
||
Results(Class<? extends UICommand> command, String message) | ||
{ | ||
this.command = command; | ||
this.message = message; | ||
} | ||
|
||
@Override | ||
public String getMessage() | ||
{ | ||
return this.message; | ||
} | ||
|
||
@Override | ||
public Class<? extends UICommand> getCommand() | ||
{ | ||
return this.command; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters