/*
* Copyright 2009 Peter Karich, peat_hal ‘at’ users ‘dot’ sourceforge ‘dot’ net.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* under the License.
*/
package de.timefinder.core.ui.command;
import de.timefinder.core.util.FixRelationShip;
import javax.swing.JOptionPane;
/**
* This UI class corrects relationship of all entities
*
* @author Peter Karich, peat_hal ‘at’ users ‘dot’ sourceforge ‘dot’ net
*/
public class FixRelationshipCommand extends AbstractImportCommand {
public static final String ID = "fixRelationship";
public FixRelationshipCommand() {
super(ID);
}
@Override
protected void doOnce() {
int ret = JOptionPane.showConfirmDialog(null, tr.get(ID + ".question"));
if (ret != JOptionPane.OK_OPTION)
return;
int counter = new FixRelationShip(dataPool).doWork();
JOptionPane.showMessageDialog(null, tr.get(ID + ".result", counter));
}
}