本文整理汇总了Java中org.geomajas.command.EmptyCommandRequest类的典型用法代码示例。如果您正苦于以下问题:Java EmptyCommandRequest类的具体用法?Java EmptyCommandRequest怎么用?Java EmptyCommandRequest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EmptyCommandRequest类属于org.geomajas.command包,在下文中一共展示了EmptyCommandRequest类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onGenerateExceptionClicked
import org.geomajas.command.EmptyCommandRequest; //导入依赖的package包/类
@UiHandler("generateExceptionButton")
protected void onGenerateExceptionClicked(ClickEvent event) {
EmptyCommandRequest request = new EmptyCommandRequest();
GwtCommand command = new GwtCommand();
command.setCommandName("command.GetSimpleExceptionCommand");
command.setCommandRequest(request);
GeomajasServerExtension.getInstance().getCommandService()
.execute(command, new AbstractCommandCallback<CommandResponse>() {
@Override
public void execute(CommandResponse response) {
// don't do anything. An Exception will been thrown at
// server-side
}
});
}
示例2: testLogout
import org.geomajas.command.EmptyCommandRequest; //导入依赖的package包/类
@Test
public void testLogout() throws Exception {
Authentication auth = new Authentication();
auth.setAuthorizations(new BaseAuthorization[0]);
auth.setSecurityServiceId(StaticSecurityService.SECURITY_SERVICE_ID); // mimic that this comes from the StaticSecurity stuff
String token = tokenService.login(auth);
DefaultSecurityContext securityContext = (DefaultSecurityContext) this.securityContext;
List<Authentication> auths = new ArrayList<Authentication>();
auths.add(auth);
securityContext.setAuthentications(token, auths);
Assert.assertEquals(token, securityContext.getToken());
EmptyCommandRequest request = new EmptyCommandRequest();
SuccessCommandResponse response = logoutCommand.getEmptyCommandResponse();
logoutCommand.execute(request, response);
Assert.assertTrue(response.isSuccess());
Assert.assertNull(tokenService.getAuthentication(token));
}
示例3: getViewPanel
import org.geomajas.command.EmptyCommandRequest; //导入依赖的package包/类
public Canvas getViewPanel() {
VLayout layout = new VLayout();
layout.setWidth100();
layout.setHeight100();
layout.setLayoutTopMargin(200);
IButton button = new IButton(MESSAGES.serverErrorButton());
button.setIcon("[ISOMORPHIC]/geomajas/osgeo/help-contents.png");
button.setWidth(300);
button.setLayoutAlign(Alignment.CENTER);
button.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
GwtCommand command = new GwtCommand("example.gwt.server.samples.GetExceptionCommand");
command.setCommandRequest(new EmptyCommandRequest());
GwtCommandDispatcher.getInstance().execute(command, new AbstractCommandCallback() {
public void execute(CommandResponse response) {
// Do nothing... an error message is shown automatically...
}
});
}
});
layout.addMember(button);
return layout;
}
示例4: execute
import org.geomajas.command.EmptyCommandRequest; //导入依赖的package包/类
@Override
public void execute(EmptyCommandRequest emptyCommandRequest, SuccessCommandResponse commandResponse)
throws Exception {
commandResponse.setSuccess(false);
for (Authentication auth : securityContext.getSecurityServiceResults()) {
if (StaticSecurityService.SECURITY_SERVICE_ID.equals(auth.getSecurityServiceId())) {
tokenService.logout(securityContext.getToken());
commandResponse.setSuccess(true);
}
}
}
示例5: execute
import org.geomajas.command.EmptyCommandRequest; //导入依赖的package包/类
@Override
public void execute(EmptyCommandRequest emptyCommandRequest, CommandResponse commandResponse) throws Exception {
if(securityContext.getToken() == null){
throw new GeomajasSecurityException(ExceptionCode.TEST);
}
if(!"marino".equals(securityContext.getUserId())){
throw new GeomajasSecurityException(ExceptionCode.TEST);
}
}
示例6: onClick
import org.geomajas.command.EmptyCommandRequest; //导入依赖的package包/类
public void onClick(MenuItemClickEvent event) {
VLayout layout = new VLayout();
layout.setPadding(WidgetLayout.marginLarge);
Img logo = new Img(WidgetLayout.aboutGeomajasLogo);
layout.addMember(logo);
HTMLFlow flow = new HTMLFlow("<h2>Geomajas " + Geomajas.getVersion() + "</h2>" +
"<p>" + MESSAGES.aboutCopyRight() + "</p>" + "<p>" + MESSAGES.aboutVisit()
+ ": <a href='http://www.geomajas.org/'>http://www.geomajas.org/</a><br />"
+ MESSAGES.sourceUrl() + ": <a href='https://github.com/geomajas/geomajas-project-client-gwt'>" +
"https://github.com/geomajas/geomajas-project-client-gwt</a> </p>");
HTMLFlow flowSmartgwt = new HTMLFlow("<h2>SmartGWT " + Version.getVersion() +
" " + Version.getSCVersionNumber() + "</h2>");
layout.addMember(flow);
layout.addMember(flowSmartgwt);
final HTMLFlow copyrightWidget = new HTMLFlow("Copyright info");
layout.addMember(copyrightWidget);
GwtCommand commandRequest = new GwtCommand(CopyrightRequest.COMMAND);
commandRequest.setCommandRequest(new EmptyCommandRequest());
GwtCommandDispatcher.getInstance().execute(commandRequest, new AbstractCommandCallback<CopyrightResponse>() {
public void execute(CopyrightResponse response) {
Collection<CopyrightInfo> copyrights = response.getCopyrights();
StringBuilder sb = new StringBuilder("<h2>");
sb.append(MESSAGES.copyrightListTitle());
sb.append("</h2><ul>");
for (CopyrightInfo copyright : copyrights) {
sb.append("<li>");
sb.append(copyright.getKey());
sb.append(" : ");
sb.append(MESSAGES.licensedAs());
sb.append(" ");
sb.append(copyright.getCopyright());
sb.append(" : <a target=\"_blank\" href=\"");
sb.append(copyright.getLicenseUrl());
sb.append("\">");
sb.append(copyright.getLicenseName());
sb.append("</a>");
if (null != copyright.getSourceUrl()) {
sb.append(" ");
sb.append(MESSAGES.sourceUrl());
sb.append(" : ");
sb.append(" <a target=\"_blank\" href=\"");
sb.append(copyright.getSourceUrl());
sb.append("\">");
sb.append(copyright.getSourceUrl());
sb.append("</a>");
}
sb.append("</li>");
}
sb.append("</ul>");
copyrightWidget.setContents(sb.toString());
}
});
Window window = new Window();
window.setHeaderIcon(WidgetLayout.iconGeomajas);
window.setTitle(MESSAGES.aboutMenuTitle());
window.setWidth(WidgetLayout.aboutGeomajasWidth);
window.setHeight(WidgetLayout.aboutGeomajasHeight);
window.setAutoCenter(true);
window.setPadding(WidgetLayout.marginLarge);
window.addItem(layout);
window.draw();
}
示例7: execute
import org.geomajas.command.EmptyCommandRequest; //导入依赖的package包/类
@Override
public void execute(EmptyCommandRequest request, CommandResponse response) throws Exception {
throw new UnserializableException();
}
示例8: getEmptyCommandRequest
import org.geomajas.command.EmptyCommandRequest; //导入依赖的package包/类
@Override
public EmptyCommandRequest getEmptyCommandRequest() {
return new EmptyCommandRequest();
}
示例9: execute
import org.geomajas.command.EmptyCommandRequest; //导入依赖的package包/类
@Override
public void execute(EmptyCommandRequest request, CommandResponse response)
throws Exception {
throw new Exception("Server-side generated exception.");
}
示例10: execute
import org.geomajas.command.EmptyCommandRequest; //导入依赖的package包/类
@Override
public void execute(EmptyCommandRequest request, CopyrightResponse response) throws Exception {
response.setCopyrights(new ArrayList<CopyrightInfo>(copyrightMap.values()));
}