本文整理汇总了Java中com.intellij.application.options.SaveSchemeDialog类的典型用法代码示例。如果您正苦于以下问题:Java SaveSchemeDialog类的具体用法?Java SaveSchemeDialog怎么用?Java SaveSchemeDialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SaveSchemeDialog类属于com.intellij.application.options包,在下文中一共展示了SaveSchemeDialog类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onSaveAs
import com.intellij.application.options.SaveSchemeDialog; //导入依赖的package包/类
private void onSaveAs() {
if (mySchemesTableModel.isProjectScheme(getSelectedScheme())) {
int rowToSelect = mySchemesTableModel.exportProjectScheme();
if (rowToSelect > 0) {
mySchemesTable.getSelectionModel().setSelectionInterval(rowToSelect, rowToSelect);
}
}
else {
CodeStyleScheme[] schemes = CodeStyleSchemes.getInstance().getSchemes();
ArrayList<String> names = new ArrayList<String>();
for (CodeStyleScheme scheme : schemes) {
names.add(scheme.getName());
}
String selectedName = getSelectedScheme().getName();
SaveSchemeDialog saveDialog =
new SaveSchemeDialog(myParent, ApplicationBundle.message("title.save.code.style.scheme.as"), names, selectedName);
if (saveDialog.showAndGet()) {
int row = mySchemesTableModel.createNewScheme(getSelectedScheme(), saveDialog.getSchemeName());
mySchemesTable.getSelectionModel().setSelectionInterval(row, row);
}
}
}
示例2: onSaveAs
import com.intellij.application.options.SaveSchemeDialog; //导入依赖的package包/类
private void onSaveAs() {
if (mySchemesTableModel.isProjectScheme(getSelectedScheme())) {
int rowToSelect = mySchemesTableModel.exportProjectScheme();
if (rowToSelect > 0) {
mySchemesTable.getSelectionModel().setSelectionInterval(rowToSelect, rowToSelect);
}
}
else {
CodeStyleScheme[] schemes = CodeStyleSchemes.getInstance().getSchemes();
ArrayList<String> names = new ArrayList<String>();
for (CodeStyleScheme scheme : schemes) {
names.add(scheme.getName());
}
SaveSchemeDialog saveDialog = new SaveSchemeDialog(myParent, ApplicationBundle.message("title.save.code.style.scheme.as"), names);
saveDialog.show();
if (saveDialog.isOK()) {
int row = mySchemesTableModel.createNewScheme(getSelectedScheme(), saveDialog.getSchemeName());
mySchemesTable.getSelectionModel().setSelectionInterval(row, row);
}
}
}
示例3: showSaveAsDialog
import com.intellij.application.options.SaveSchemeDialog; //导入依赖的package包/类
private void showSaveAsDialog() {
List<String> names = ContainerUtil.newArrayList(myOptions.getSchemeNames());
String selectedName = myOptions.getSelectedScheme().getName();
SaveSchemeDialog dialog = new SaveSchemeDialog(this, ApplicationBundle.message("title.save.color.scheme.as"), names, selectedName);
if (dialog.showAndGet()) {
myOptions.saveSchemeAs(dialog.getSchemeName());
}
}
示例4: showSaveAsDialog
import com.intellij.application.options.SaveSchemeDialog; //导入依赖的package包/类
private void showSaveAsDialog() {
ArrayList<String> names = new ArrayList<String>();
EditorColorsScheme[] allSchemes = EditorColorsManager.getInstance().getAllSchemes();
for (EditorColorsScheme scheme : allSchemes) {
names.add(scheme.getName());
}
SaveSchemeDialog dialog = new SaveSchemeDialog(this, ApplicationBundle.message("title.save.color.scheme.as"), names);
dialog.show();
if (dialog.isOK()) {
myOptions.saveSchemeAs(dialog.getSchemeName());
}
}