blob: 14f33783360343d40c6a159b25a5133bea8bf47e [file] [log] [blame]
/*
* Copyright 2000-2009 JetBrains s.r.o.
*
* 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.
*/
package com.intellij.cvsSupport2.cvsoperations.cvsEdit.ui;
import com.intellij.cvsSupport2.CvsVcs2;
import com.intellij.cvsSupport2.config.CvsConfiguration;
import com.intellij.openapi.project.Project;
import com.intellij.util.ui.OptionsDialog;
import javax.swing.*;
import java.awt.*;
/**
* author: lesya
*/
public class EditOptionsDialog extends OptionsDialog {
private final JPanel myPanel = new JPanel(new BorderLayout());
private final JCheckBox myReservedEdit = new JCheckBox(com.intellij.CvsBundle.message("checkbox.text.reserved.edit"));
public EditOptionsDialog(Project project) {
super(project);
myPanel.add(myReservedEdit, BorderLayout.NORTH);
myReservedEdit.setSelected(CvsConfiguration.getInstance(project).RESERVED_EDIT);
setTitle(com.intellij.CvsBundle.message("dialog.title.edit.options"));
init();
}
protected boolean isToBeShown() {
return CvsVcs2.getInstance(myProject).getEditOptions().getValue();
}
protected void setToBeShown(boolean value, boolean onOk) {
CvsVcs2.getInstance(myProject).getEditOptions().setValue(value);
}
protected JComponent createCenterPanel() {
return myPanel;
}
protected void doOKAction() {
CvsConfiguration.getInstance(myProject).RESERVED_EDIT = myReservedEdit.isSelected();
super.doOKAction();
}
protected boolean shouldSaveOptionsOnCancel() {
return false;
}
}