Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: coduz <alberto.codutti@eurotech.com>
- Loading branch information
Showing
8 changed files
with
146 additions
and
19 deletions.
There are no files selected for viewing
74 changes: 74 additions & 0 deletions
74
.../src/main/java/org/eclipse/kapua/app/console/module/job/client/JobDeleteForcedDialog.java
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,74 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2017, 2019 Eurotech and/or its affiliates and others | ||
* | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Eurotech - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.kapua.app.console.module.job.client; | ||
|
||
import com.google.gwt.core.client.GWT; | ||
import com.google.gwt.user.client.rpc.AsyncCallback; | ||
import org.eclipse.kapua.app.console.module.api.client.resources.icons.IconSet; | ||
import org.eclipse.kapua.app.console.module.api.client.resources.icons.KapuaIcon; | ||
import org.eclipse.kapua.app.console.module.api.client.ui.dialog.entity.EntityDeleteDialog; | ||
import org.eclipse.kapua.app.console.module.api.client.util.DialogUtils; | ||
import org.eclipse.kapua.app.console.module.job.client.messages.ConsoleJobMessages; | ||
import org.eclipse.kapua.app.console.module.job.shared.model.GwtJob; | ||
import org.eclipse.kapua.app.console.module.job.shared.service.GwtJobService; | ||
import org.eclipse.kapua.app.console.module.job.shared.service.GwtJobServiceAsync; | ||
|
||
public class JobDeleteForcedDialog extends EntityDeleteDialog { | ||
|
||
private final GwtJob selectedJob; | ||
|
||
private static final ConsoleJobMessages JOB_MSGS = GWT.create(ConsoleJobMessages.class); | ||
private static final GwtJobServiceAsync GWT_JOB_SERVICE = GWT.create(GwtJobService.class); | ||
|
||
public JobDeleteForcedDialog(GwtJob selectedJob) { | ||
this.selectedJob = selectedJob; | ||
DialogUtils.resizeDialog(this, 300, 135); | ||
// setDisabledFormPanelEvents(true); | ||
} | ||
|
||
@Override | ||
public void submit() { | ||
GWT_JOB_SERVICE.deleteForced(xsrfToken, selectedJob.getScopeId(), selectedJob.getId(), new AsyncCallback<Void>() { | ||
|
||
@Override | ||
public void onSuccess(Void arg0) { | ||
exitStatus = true; | ||
exitMessage = JOB_MSGS.dialogDeleteForcedStoppedMessage(); | ||
hide(); | ||
} | ||
|
||
@Override | ||
public void onFailure(Throwable cause) { | ||
exitStatus = false; | ||
// if (!isPermissionErrorMessage(cause)) { | ||
exitMessage = JOB_MSGS.dialogDeleteForcedErrorMessage(); | ||
// } | ||
hide(); | ||
} | ||
}); | ||
} | ||
|
||
@Override | ||
public String getHeaderMessage() { | ||
return JOB_MSGS.dialogDeleteForcedDialogHeader(selectedJob.getJobName()); | ||
} | ||
|
||
@Override | ||
public String getInfoMessage() { | ||
return JOB_MSGS.dialogDeleteForcedDialogInfo(); | ||
} | ||
|
||
@Override | ||
public KapuaIcon getInfoIcon() { | ||
return new KapuaIcon(IconSet.EXCLAMATION_TRIANGLE); | ||
} | ||
} |
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