本文整理汇总了Java中com.intellij.openapi.vcs.VcsConfiguration.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java VcsConfiguration.getInstance方法的具体用法?Java VcsConfiguration.getInstance怎么用?Java VcsConfiguration.getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.vcs.VcsConfiguration
的用法示例。
在下文中一共展示了VcsConfiguration.getInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: runCheckinHandlers
import com.intellij.openapi.vcs.VcsConfiguration; //导入方法依赖的package包/类
@Override
public void runCheckinHandlers(@NotNull final Runnable finishAction) {
final VcsConfiguration configuration = VcsConfiguration.getInstance(myProject);
final Collection<VirtualFile> files = myPanel.getVirtualFiles();
final Runnable performCheckoutAction = new Runnable() {
@Override
public void run() {
FileDocumentManager.getInstance().saveAllDocuments();
finishAction.run();
}
};
if (configuration.OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT && !DumbService.isDumb(myProject)) {
new OptimizeImportsProcessor(myProject, CheckinHandlerUtil.getPsiFiles(myProject, files), COMMAND_NAME, performCheckoutAction).run();
} else {
finishAction.run();
}
}
示例2: runCheckinHandlers
import com.intellij.openapi.vcs.VcsConfiguration; //导入方法依赖的package包/类
@Override
public void runCheckinHandlers(@NotNull final Runnable finishAction) {
final VcsConfiguration configuration = VcsConfiguration.getInstance(myProject);
final Collection<VirtualFile> files = myPanel.getVirtualFiles();
final Runnable performCheckoutAction = new Runnable() {
@Override
public void run() {
FileDocumentManager.getInstance().saveAllDocuments();
finishAction.run();
}
};
if (reformat(configuration, true)) {
new ReformatCodeProcessor(
myProject, CheckinHandlerUtil.getPsiFiles(myProject, files), FormatterUtil.REFORMAT_BEFORE_COMMIT_COMMAND_NAME, performCheckoutAction, true
).run();
}
else {
performCheckoutAction.run();
}
}
示例3: runCheckinHandlers
import com.intellij.openapi.vcs.VcsConfiguration; //导入方法依赖的package包/类
@Override
public void runCheckinHandlers(@NotNull final Runnable finishAction) {
final Runnable performCheckoutAction = new Runnable() {
@Override
public void run() {
FileDocumentManager.getInstance().saveAllDocuments();
finishAction.run();
}
};
if (VcsConfiguration.getInstance(myProject).REARRANGE_BEFORE_PROJECT_COMMIT && !DumbService.isDumb(myProject)) {
new RearrangeCodeProcessor(
myProject, CheckinHandlerUtil.getPsiFiles(myProject, myPanel.getVirtualFiles()), COMMAND_NAME, performCheckoutAction
).run();
}
else {
performCheckoutAction.run();
}
}
示例4: reset
import com.intellij.openapi.vcs.VcsConfiguration; //导入方法依赖的package包/类
public void reset() {
VcsConfiguration settings = VcsConfiguration.getInstance(myProject);
myCbCommitInBackground.setSelected(settings.PERFORM_COMMIT_IN_BACKGROUND);
myCbUpdateInBackground.setSelected(settings.PERFORM_UPDATE_IN_BACKGROUND);
myCbCheckoutInBackground.setSelected(settings.PERFORM_CHECKOUT_IN_BACKGROUND);
myCbEditInBackground.setSelected(settings.PERFORM_EDIT_IN_BACKGROUND);
myCbAddRemoveInBackground.setSelected(settings.PERFORM_ADD_REMOVE_IN_BACKGROUND);
myPerformRevertInBackgroundCheckBox.setSelected(settings.PERFORM_ROLLBACK_IN_BACKGROUND);
for (VcsShowOptionsSettingImpl setting : myPromptOptions.keySet()) {
myPromptOptions.get(setting).setSelected(setting.getValue());
}
if (! myProject.isDefault()) {
myTrackChangedOnServer.setSelected(settings.CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND);
myChangedOnServerInterval.setValue(settings.CHANGED_ON_SERVER_INTERVAL);
myChangedOnServerInterval.setEnabled(myTrackChangedOnServer.isSelected());
myCacheSettingsPanel.reset();
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:VcsBackgroundOperationsConfigurationPanel.java
示例5: getHistory
import com.intellij.openapi.vcs.VcsConfiguration; //导入方法依赖的package包/类
private static List<HgFileRevision> getHistory(FilePath filePath, VirtualFile vcsRoot, Project project) {
VcsConfiguration vcsConfiguration = VcsConfiguration.getInstance(project);
int limit = vcsConfiguration.LIMIT_HISTORY ? vcsConfiguration.MAXIMUM_HISTORY_ROWS : -1;
final HgLogCommand logCommand = new HgLogCommand(project);
logCommand
.setFollowCopies(!filePath.isDirectory());
logCommand.setIncludeRemoved(true);
try {
return logCommand.execute(new HgFile(vcsRoot, filePath), limit, false);
}
catch (HgCommandException e) {
new HgCommandResultNotifier(project).notifyError(null, HgVcsMessages.message("hg4idea.error.log.command.execution"), e.getMessage());
return Collections.emptyList();
}
}
示例6: apply
import com.intellij.openapi.vcs.VcsConfiguration; //导入方法依赖的package包/类
public void apply() throws ConfigurationException {
VcsConfiguration settings = VcsConfiguration.getInstance(myProject);
settings.PERFORM_COMMIT_IN_BACKGROUND = myCbCommitInBackground.isSelected();
settings.PERFORM_UPDATE_IN_BACKGROUND = myCbUpdateInBackground.isSelected();
settings.PERFORM_CHECKOUT_IN_BACKGROUND = myCbCheckoutInBackground.isSelected();
settings.PERFORM_EDIT_IN_BACKGROUND = myCbEditInBackground.isSelected();
settings.PERFORM_ADD_REMOVE_IN_BACKGROUND = myCbAddRemoveInBackground.isSelected();
settings.PERFORM_ROLLBACK_IN_BACKGROUND = myPerformRevertInBackgroundCheckBox.isSelected();
boolean remoteCacheStateChanged = settings.CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND != myTrackChangedOnServer.isSelected();
if (! myProject.isDefault()) {
settings.CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND = myTrackChangedOnServer.isSelected();
settings.CHANGED_ON_SERVER_INTERVAL = ((Number) myChangedOnServerInterval.getValue()).intValue();
myCacheSettingsPanel.apply();
}
for (VcsShowOptionsSettingImpl setting : myPromptOptions.keySet()) {
setting.setValue(myPromptOptions.get(setting).isSelected());
}
// will check if should + was started -> inside
RemoteRevisionsCache.getInstance(myProject).updateAutomaticRefreshAlarmState(remoteCacheStateChanged);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:VcsBackgroundOperationsConfigurationPanel.java
示例7: runCheckinHandlers
import com.intellij.openapi.vcs.VcsConfiguration; //导入方法依赖的package包/类
@Override
public void runCheckinHandlers(@NotNull Runnable runnable) {
if (VcsConfiguration.getInstance(myProject).CHECK_CODE_CLEANUP_BEFORE_PROJECT_COMMIT && !DumbService.isDumb(myProject)) {
List<VirtualFile> filesToProcess = CheckinHandlerUtil.filterOutGeneratedAndExcludedFiles(myPanel.getVirtualFiles(), myProject);
GlobalInspectionContextBase.codeCleanup(myProject, new AnalysisScope(myProject, filesToProcess), runnable);
} else {
runnable.run();
}
}
示例8: reportAppendableHistory
import com.intellij.openapi.vcs.VcsConfiguration; //导入方法依赖的package包/类
@Override
public void reportAppendableHistory(FilePath path, final VcsAppendableHistorySessionPartner partner) throws VcsException {
// request MAXIMUM_HISTORY_ROWS + 1 log entries to be able to detect if there are more log entries than it is configured to show -
// see LimitHistoryCheck
VcsConfiguration configuration = VcsConfiguration.getInstance(myVcs.getProject());
int limit = configuration.LIMIT_HISTORY ? configuration.MAXIMUM_HISTORY_ROWS + 1 : 0;
reportAppendableHistory(path, partner, null, null, limit, null, false);
}
示例9: ChangesFragmentedDiffPanel
import com.intellij.openapi.vcs.VcsConfiguration; //导入方法依赖的package包/类
public ChangesFragmentedDiffPanel(final Project project, String filePath, JComponent parent) {
myProject = project;
myParent = parent;
myConfiguration = VcsConfiguration.getInstance(myProject);
myFilePath = filePath;
myPanel = new JPanel(new BorderLayout());
myNextDiff = new MyNextDiffAction();
myPreviousDiff = new MyPreviousDiffAction();
myTitleLabel = new JLabel(myFilePath);
}
示例10: getSelectedList
import com.intellij.openapi.vcs.VcsConfiguration; //导入方法依赖的package包/类
@Nullable
public LocalChangeList getSelectedList(Project project) {
ChangeListManager manager = ChangeListManager.getInstance(project);
if (myRbNew.isSelected()) {
String newText = myNewListPanel.getChangeListName();
if (manager.findChangeList(newText) != null) {
Messages.showErrorDialog(project,
VcsBundle.message("changes.newchangelist.warning.already.exists.text", newText),
VcsBundle.message("changes.newchangelist.warning.already.exists.title"));
return null;
}
}
if (myRbExisting.isSelected()) {
return (LocalChangeList)myExistingListsCombo.getSelectedItem();
}
else {
LocalChangeList changeList = manager.addChangeList(myNewListPanel.getChangeListName(), myNewListPanel.getDescription());
myNewListPanel.changelistCreatedOrChanged(changeList);
if (myNewListPanel.getMakeActiveCheckBox().isSelected()) {
manager.setDefaultChangeList(changeList);
}
VcsConfiguration.getInstance(project).MAKE_NEW_CHANGELIST_ACTIVE = myNewListPanel.getMakeActiveCheckBox().isSelected();
return changeList;
}
}
示例11: isModified
import com.intellij.openapi.vcs.VcsConfiguration; //导入方法依赖的package包/类
public boolean isModified() {
VcsConfiguration settings = VcsConfiguration.getInstance(myProject);
if (settings.PERFORM_COMMIT_IN_BACKGROUND != myCbCommitInBackground.isSelected()) {
return true;
}
if (settings.PERFORM_UPDATE_IN_BACKGROUND != myCbUpdateInBackground.isSelected()) {
return true;
}
if (settings.PERFORM_CHECKOUT_IN_BACKGROUND != myCbCheckoutInBackground.isSelected()) {
return true;
}
if (settings.PERFORM_EDIT_IN_BACKGROUND != myCbEditInBackground.isSelected()) {
return true;
}
if (settings.PERFORM_ADD_REMOVE_IN_BACKGROUND != myCbAddRemoveInBackground.isSelected()) {
return true;
}
if (settings.PERFORM_ROLLBACK_IN_BACKGROUND != myPerformRevertInBackgroundCheckBox.isSelected()) {
return true;
}
if (! myProject.isDefault()) {
if (settings.CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND != myTrackChangedOnServer.isSelected()) {
return true;
}
if (myCacheSettingsPanel.isModified()) return true;
if (settings.CHANGED_ON_SERVER_INTERVAL != ((Number) myChangedOnServerInterval.getValue()).intValue()) return true;
}
return false;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:35,代码来源:VcsBackgroundOperationsConfigurationPanel.java
示例12: getSettings
import com.intellij.openapi.vcs.VcsConfiguration; //导入方法依赖的package包/类
protected VcsConfiguration getSettings() {
return VcsConfiguration.getInstance(myProject);
}
示例13: configure
import com.intellij.openapi.vcs.VcsConfiguration; //导入方法依赖的package包/类
@Override
public void configure(@NotNull MavenProject mavenProject, @NotNull Project project, @Nullable Module module) {
if (module == null) return;
Element cfg = mavenProject.getPluginConfiguration("com.googlecode", "maven-idea-plugin");
if (cfg == null) return;
configureJdk(cfg, module);
MavenProjectsManager projectsManager = MavenProjectsManager.getInstance(project);
String downloadSources = cfg.getChildTextTrim("downloadSources");
if (!StringUtil.isEmptyOrSpaces(downloadSources)) {
projectsManager.getImportingSettings().setDownloadSourcesAutomatically(Boolean.parseBoolean(downloadSources));
}
String downloadJavadocs = cfg.getChildTextTrim("downloadJavadocs");
if (!StringUtil.isEmptyOrSpaces(downloadJavadocs)) {
projectsManager.getImportingSettings().setDownloadDocsAutomatically(Boolean.parseBoolean(downloadJavadocs));
}
String assertNotNull = cfg.getChildTextTrim("assertNotNull");
if (!StringUtil.isEmptyOrSpaces(assertNotNull)) {
CompilerConfiguration.getInstance(project).setAddNotNullAssertions(Boolean.parseBoolean(assertNotNull));
}
String autoscrollToSource = cfg.getChildTextTrim("autoscrollToSource");
if (!StringUtil.isEmptyOrSpaces(autoscrollToSource)) {
((ProjectViewImpl)ProjectView.getInstance(project)).setAutoscrollToSource(Boolean.parseBoolean(autoscrollToSource), ProjectViewPane.ID);
}
String autoscrollFromSource = cfg.getChildTextTrim("autoscrollFromSource");
if (!StringUtil.isEmptyOrSpaces(autoscrollFromSource)) {
((ProjectViewImpl)ProjectView.getInstance(project)).setAutoscrollFromSource(Boolean.parseBoolean(autoscrollFromSource), ProjectViewPane.ID);
}
String hideEmptyPackages = cfg.getChildTextTrim("hideEmptyPackages");
if (!StringUtil.isEmptyOrSpaces(hideEmptyPackages)) {
ProjectView.getInstance(project).setHideEmptyPackages(Boolean.parseBoolean(hideEmptyPackages), ProjectViewPane.ID);
}
String optimizeImportsBeforeCommit = cfg.getChildTextTrim("optimizeImportsBeforeCommit");
if (!StringUtil.isEmptyOrSpaces(optimizeImportsBeforeCommit)) {
VcsConfiguration.getInstance(module.getProject()).OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT = Boolean.parseBoolean(optimizeImportsBeforeCommit);
}
String performCodeAnalisisBeforeCommit = cfg.getChildTextTrim("performCodeAnalisisBeforeCommit");
if (!StringUtil.isEmptyOrSpaces(performCodeAnalisisBeforeCommit)) {
VcsConfiguration.getInstance(module.getProject()).CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT = Boolean.parseBoolean(performCodeAnalisisBeforeCommit);
}
String reformatCodeBeforeCommit = cfg.getChildTextTrim("reformatCodeBeforeCommit");
if (!StringUtil.isEmptyOrSpaces(reformatCodeBeforeCommit)) {
VcsConfiguration vcsConfiguration = VcsConfiguration.getInstance(module.getProject());
boolean value = Boolean.parseBoolean(reformatCodeBeforeCommit);
vcsConfiguration.REFORMAT_BEFORE_FILE_COMMIT = value;
vcsConfiguration.REFORMAT_BEFORE_PROJECT_COMMIT = value;
}
}
示例14: getSettings
import com.intellij.openapi.vcs.VcsConfiguration; //导入方法依赖的package包/类
private VcsConfiguration getSettings() {
return VcsConfiguration.getInstance(myProject);
}
示例15: TodoCheckinHandler
import com.intellij.openapi.vcs.VcsConfiguration; //导入方法依赖的package包/类
public TodoCheckinHandler(CheckinProjectPanel checkinProjectPanel) {
myProject = checkinProjectPanel.getProject();
myCheckinProjectPanel = checkinProjectPanel;
myConfiguration = VcsConfiguration.getInstance(myProject);
}