use of org.eclipse.che.ide.api.dialogs.ChoiceDialog in project che by eclipse.
the class EditDebugConfigurationsPresenter method createNewConfiguration.
private void createNewConfiguration(final DebugConfigurationType type, final String customName, final Map<String, String> attributes) {
if (!isViewModified()) {
reset();
createConfiguration(type, customName, attributes);
return;
}
final ConfirmCallback saveCallback = new ConfirmCallback() {
@Override
public void accepted() {
updateConfiguration(editedConfiguration);
reset();
createConfiguration(type, customName, attributes);
}
};
final ConfirmCallback discardCallback = new ConfirmCallback() {
@Override
public void accepted() {
fetchConfigurations();
reset();
createConfiguration(type, customName, attributes);
}
};
final ChoiceDialog dialog = dialogFactory.createChoiceDialog(locale.editConfigurationsSaveChangesTitle(), locale.editConfigurationsSaveChangesConfirmation(editedConfiguration.getName()), coreLocale.save(), locale.editConfigurationsSaveChangesDiscard(), saveCallback, discardCallback);
dialog.show();
}
use of org.eclipse.che.ide.api.dialogs.ChoiceDialog in project che by eclipse.
the class EditCommandsPresenter method createNewCommand.
private void createNewCommand(final String type, final String commandLine, final String name, final Map<String, String> attributes) {
if (!isViewModified()) {
createCommand(type, commandLine, name, attributes);
return;
}
final ConfirmCallback saveCallback = new ConfirmCallback() {
@Override
public void accepted() {
updateCommand(editedCommand).then(new Operation<CommandImpl>() {
@Override
public void apply(CommandImpl arg) throws OperationException {
createCommand(type, commandLine, name, attributes);
}
});
}
};
final ConfirmCallback discardCallback = new ConfirmCallback() {
@Override
public void accepted() {
refreshView();
createCommand(type, commandLine, name, attributes);
}
};
ChoiceDialog dialog = dialogFactory.createChoiceDialog(machineLocale.editCommandsSaveChangesTitle(), machineLocale.editCommandsSaveChangesConfirmation(editedCommand.getName()), coreLocale.save(), machineLocale.editCommandsSaveChangesDiscard(), saveCallback, discardCallback);
dialog.show();
}
use of org.eclipse.che.ide.api.dialogs.ChoiceDialog in project che by eclipse.
the class EditDebugConfigurationsPresenter method onConfigurationSelected.
@Override
public void onConfigurationSelected(final DebugConfiguration configuration) {
if (!isViewModified()) {
handleConfigurationSelection(configuration);
return;
}
final ConfirmCallback saveCallback = new ConfirmCallback() {
@Override
public void accepted() {
updateConfiguration(editedConfiguration);
fetchConfigurations();
handleConfigurationSelection(configuration);
}
};
final ConfirmCallback discardCallback = new ConfirmCallback() {
@Override
public void accepted() {
reset();
fetchConfigurations();
handleConfigurationSelection(configuration);
}
};
final ChoiceDialog dialog = dialogFactory.createChoiceDialog(locale.editConfigurationsSaveChangesTitle(), locale.editConfigurationsSaveChangesConfirmation(editedConfiguration.getName()), coreLocale.save(), locale.editConfigurationsSaveChangesDiscard(), saveCallback, discardCallback);
dialog.show();
}
use of org.eclipse.che.ide.api.dialogs.ChoiceDialog in project che by eclipse.
the class EditCommandsPresenter method onCommandSelected.
@Override
public void onCommandSelected(final CommandImpl command) {
if (!isViewModified()) {
handleCommandSelection(command);
return;
}
final ConfirmCallback saveCallback = new ConfirmCallback() {
@Override
public void accepted() {
updateCommand(editedCommand).then(new Operation<CommandImpl>() {
@Override
public void apply(CommandImpl arg) throws OperationException {
refreshView();
handleCommandSelection(command);
}
});
}
};
final ConfirmCallback discardCallback = new ConfirmCallback() {
@Override
public void accepted() {
refreshView();
handleCommandSelection(command);
}
};
ChoiceDialog dialog = dialogFactory.createChoiceDialog(machineLocale.editCommandsSaveChangesTitle(), machineLocale.editCommandsSaveChangesConfirmation(editedCommand.getName()), coreLocale.save(), machineLocale.editCommandsSaveChangesDiscard(), saveCallback, discardCallback);
dialog.show();
}
Aggregations