mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge branch 'master' of git.labs.intellij.net:idea/community
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
The source code for JPS, JetBrains' Gant-based build system used for
|
||||
building IntelliJ, can be found on GitHub:
|
||||
|
||||
http://github.com/shafirov/JPS
|
||||
@@ -1,5 +1,18 @@
|
||||
// VistaUpdaterLauncher.cpp : Defines the entry point for the console application.
|
||||
//
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include <windows.h>
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#if defined(WIN32)
|
||||
#include <windows.h>
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
========================================================================
|
||||
CONSOLE APPLICATION : fileWatcher3 Project Overview
|
||||
========================================================================
|
||||
|
||||
AppWizard has created this fileWatcher3 application for you.
|
||||
|
||||
This file contains a summary of what you will find in each of the files that
|
||||
make up your fileWatcher3 application.
|
||||
|
||||
|
||||
fileWatcher3.vcproj
|
||||
This is the main project file for VC++ projects generated using an Application Wizard.
|
||||
It contains information about the version of Visual C++ that generated the file, and
|
||||
information about the platforms, configurations, and project features selected with the
|
||||
Application Wizard.
|
||||
|
||||
fileWatcher3.cpp
|
||||
This is the main application source file.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
Other standard files:
|
||||
|
||||
StdAfx.h, StdAfx.cpp
|
||||
These files are used to build a precompiled header (PCH) file
|
||||
named fileWatcher3.pch and a precompiled types file named StdAfx.obj.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
Other notes:
|
||||
|
||||
AppWizard uses "TODO:" comments to indicate parts of the source code you
|
||||
should add to or customize.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
@@ -1,5 +1,18 @@
|
||||
// fileWatcher3.cpp : Defines the entry point for the console application.
|
||||
//
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <CoreServices/CoreServices.h>
|
||||
#include <sys/mount.h>
|
||||
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
========================================================================
|
||||
CONSOLE APPLICATION : restarter Project Overview
|
||||
========================================================================
|
||||
|
||||
AppWizard has created this restarter application for you.
|
||||
|
||||
This file contains a summary of what you will find in each of the files that
|
||||
make up your restarter application.
|
||||
|
||||
|
||||
restarter.vcproj
|
||||
This is the main project file for VC++ projects generated using an Application Wizard.
|
||||
It contains information about the version of Visual C++ that generated the file, and
|
||||
information about the platforms, configurations, and project features selected with the
|
||||
Application Wizard.
|
||||
|
||||
restarter.cpp
|
||||
This is the main application source file.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
Other standard files:
|
||||
|
||||
StdAfx.h, StdAfx.cpp
|
||||
These files are used to build a precompiled header (PCH) file
|
||||
named restarter.pch and a precompiled types file named StdAfx.obj.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
Other notes:
|
||||
|
||||
AppWizard uses "TODO:" comments to indicate parts of the source code you
|
||||
should add to or customize.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
@@ -1,5 +1,18 @@
|
||||
// restarter.cpp : Defines the entry point for the console application.
|
||||
//
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 646 B |
Binary file not shown.
|
After Width: | Height: | Size: 533 B |
Binary file not shown.
|
Before Width: | Height: | Size: 381 B After Width: | Height: | Size: 423 B |
Binary file not shown.
|
Before Width: | Height: | Size: 368 B |
Binary file not shown.
|
After Width: | Height: | Size: 619 B |
+4
-35
@@ -23,15 +23,14 @@ import com.intellij.codeInsight.hint.HintManager;
|
||||
import com.intellij.codeInsight.intention.AbstractIntentionAction;
|
||||
import com.intellij.codeInsight.intention.IntentionAction;
|
||||
import com.intellij.codeInsight.intention.IntentionManager;
|
||||
import com.intellij.codeInsight.intention.PsiElementBaseIntentionAction;
|
||||
import com.intellij.codeInsight.intention.impl.IntentionHintComponent;
|
||||
import com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler;
|
||||
import com.intellij.codeInsight.intention.impl.config.IntentionManagerSettings;
|
||||
import com.intellij.codeInsight.lookup.LookupManager;
|
||||
import com.intellij.codeInsight.template.impl.TemplateManagerImpl;
|
||||
import com.intellij.codeInsight.template.impl.TemplateState;
|
||||
import com.intellij.ide.DataManager;
|
||||
import com.intellij.lang.annotation.HighlightSeverity;
|
||||
import com.intellij.lang.injection.InjectedLanguageManager;
|
||||
import com.intellij.openapi.actionSystem.ActionManager;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
@@ -44,14 +43,13 @@ import com.intellij.openapi.editor.LogicalPosition;
|
||||
import com.intellij.openapi.editor.markup.GutterIconRenderer;
|
||||
import com.intellij.openapi.fileEditor.FileDocumentManager;
|
||||
import com.intellij.openapi.progress.ProgressIndicator;
|
||||
import com.intellij.openapi.project.IndexNotReadyException;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.popup.JBPopupFactory;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.psi.IntentionFilterOwner;
|
||||
import com.intellij.psi.PsiDocumentManager;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil;
|
||||
import com.intellij.ui.awt.RelativePoint;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
@@ -188,27 +186,13 @@ public class ShowIntentionsPass extends TextEditorHighlightingPass {
|
||||
public static void getActionsToShow(@NotNull final Editor editor, @NotNull final PsiFile psiFile, @NotNull IntentionsInfo intentions, int passIdToShowIntentionsFor) {
|
||||
final PsiElement psiElement = psiFile.findElementAt(editor.getCaretModel().getOffset());
|
||||
LOG.assertTrue(psiElement == null || psiElement.isValid(), psiElement);
|
||||
final boolean isInProject = psiFile.getManager().isInProject(psiFile);
|
||||
|
||||
int offset = editor.getCaretModel().getOffset();
|
||||
Project project = psiFile.getProject();
|
||||
|
||||
PsiElement injected = InjectedLanguageManager.getInstance(project).findInjectedElementAt(psiFile, offset);
|
||||
PsiFile injectedFile;
|
||||
Editor injectedEditor;
|
||||
if (injected != null) {
|
||||
injectedFile = injected.getContainingFile();
|
||||
injectedEditor = InjectedLanguageUtil.getInjectedEditorForInjectedFile(editor, injectedFile);
|
||||
}
|
||||
else {
|
||||
injectedFile = null;
|
||||
injectedEditor = null;
|
||||
}
|
||||
|
||||
for (IntentionAction action : IntentionManager.getInstance().getIntentionActions()) {
|
||||
if (injectedFile != null && isAvailableHere(injectedEditor, injectedFile, injected, isInProject, project, action) ||
|
||||
isAvailableHere(editor, psiFile, psiElement, isInProject, project, action)
|
||||
) {
|
||||
Pair<PsiFile,Editor> place = ShowIntentionActionsHandler.availableFor(psiFile, editor, action, psiElement);
|
||||
if (place != null) {
|
||||
List<IntentionAction> enableDisableIntentionAction = new ArrayList<IntentionAction>();
|
||||
enableDisableIntentionAction.add(new IntentionHintComponent.EnableDisableIntentionAction(action));
|
||||
intentions.intentionsToShow.add(new HighlightInfo.IntentionActionDescriptor(action, enableDisableIntentionAction, null));
|
||||
@@ -256,19 +240,4 @@ public class ShowIntentionsPass extends TextEditorHighlightingPass {
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isAvailableHere(Editor editor, PsiFile psiFile, PsiElement psiElement, boolean inProject, Project project,
|
||||
IntentionAction action) {
|
||||
try {
|
||||
if (action instanceof PsiElementBaseIntentionAction) {
|
||||
if (!inProject || !((PsiElementBaseIntentionAction)action).isAvailable(project, editor, psiElement)) return false;
|
||||
}
|
||||
else if (!action.isAvailable(project, editor, psiFile)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (IndexNotReadyException e) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
+39
-34
@@ -29,6 +29,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.popup.*;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.Iconable;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil;
|
||||
import com.intellij.psi.util.PsiUtilBase;
|
||||
@@ -83,52 +84,56 @@ class IntentionListStep implements ListPopupStep<IntentionActionWithTextCaching>
|
||||
|
||||
private boolean wrapActionsTo(final List<HighlightInfo.IntentionActionDescriptor> descriptors, final Set<IntentionActionWithTextCaching> cachedActions) {
|
||||
boolean result = true;
|
||||
for (HighlightInfo.IntentionActionDescriptor descriptor : descriptors) {
|
||||
IntentionAction action = descriptor.getAction();
|
||||
IntentionActionWithTextCaching cachedAction = new IntentionActionWithTextCaching(action, descriptor.getDisplayName(), descriptor.getIcon());
|
||||
result &= !cachedActions.add(cachedAction);
|
||||
final int caretOffset = myEditor.getCaretModel().getOffset();
|
||||
final int fileOffset = caretOffset > 0 && caretOffset == myFile.getTextLength() ? caretOffset - 1 : caretOffset;
|
||||
PsiElement element;
|
||||
if (myFile instanceof PsiCompiledElement) {
|
||||
element = myFile;
|
||||
}
|
||||
else if (PsiDocumentManager.getInstance(myProject).isUncommited(myEditor.getDocument())) {
|
||||
//???
|
||||
FileViewProvider viewProvider = myFile.getViewProvider();
|
||||
element = viewProvider.findElementAt(fileOffset, viewProvider.getBaseLanguage());
|
||||
}
|
||||
else {
|
||||
element = InjectedLanguageUtil.findElementAtNoCommit(myFile, fileOffset);
|
||||
}
|
||||
final List<IntentionAction> options;
|
||||
if (element != null && (options = descriptor.getOptions(element)) != null) {
|
||||
for (IntentionAction option : options) {
|
||||
boolean isErrorFix = myCachedErrorFixes.contains(new IntentionActionWithTextCaching(option, option.getText()));
|
||||
if (isErrorFix) {
|
||||
cachedAction.addErrorFix(option);
|
||||
}
|
||||
boolean isInspectionFix = myCachedInspectionFixes.contains(new IntentionActionWithTextCaching(option, option.getText()));
|
||||
if (isInspectionFix) {
|
||||
cachedAction.addInspectionFix(option);
|
||||
}
|
||||
else {
|
||||
cachedAction.addIntention(option);
|
||||
final int caretOffset = myEditor.getCaretModel().getOffset();
|
||||
final int fileOffset = caretOffset > 0 && caretOffset == myFile.getTextLength() ? caretOffset - 1 : caretOffset;
|
||||
PsiElement element;
|
||||
if (myFile instanceof PsiCompiledElement) {
|
||||
element = myFile;
|
||||
}
|
||||
else if (PsiDocumentManager.getInstance(myProject).isUncommited(myEditor.getDocument())) {
|
||||
//???
|
||||
FileViewProvider viewProvider = myFile.getViewProvider();
|
||||
element = viewProvider.findElementAt(fileOffset, viewProvider.getBaseLanguage());
|
||||
}
|
||||
else {
|
||||
element = InjectedLanguageUtil.findElementAtNoCommit(myFile, fileOffset);
|
||||
}
|
||||
if (!descriptors.isEmpty()) {
|
||||
|
||||
for (HighlightInfo.IntentionActionDescriptor descriptor : descriptors) {
|
||||
IntentionAction action = descriptor.getAction();
|
||||
IntentionActionWithTextCaching cachedAction = new IntentionActionWithTextCaching(action, descriptor.getDisplayName(), descriptor.getIcon());
|
||||
result &= !cachedActions.add(cachedAction);
|
||||
final List<IntentionAction> options;
|
||||
if (element != null && (options = descriptor.getOptions(element)) != null) {
|
||||
for (IntentionAction option : options) {
|
||||
boolean isErrorFix = myCachedErrorFixes.contains(new IntentionActionWithTextCaching(option, option.getText()));
|
||||
if (isErrorFix) {
|
||||
cachedAction.addErrorFix(option);
|
||||
}
|
||||
boolean isInspectionFix = myCachedInspectionFixes.contains(new IntentionActionWithTextCaching(option, option.getText()));
|
||||
if (isInspectionFix) {
|
||||
cachedAction.addInspectionFix(option);
|
||||
}
|
||||
else {
|
||||
cachedAction.addIntention(option);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
result &= removeInvalidActions(cachedActions);
|
||||
result &= removeInvalidActions(cachedActions, element);
|
||||
return result;
|
||||
}
|
||||
|
||||
private boolean removeInvalidActions(final Collection<IntentionActionWithTextCaching> cachedActions) {
|
||||
private boolean removeInvalidActions(final Collection<IntentionActionWithTextCaching> cachedActions, final PsiElement element) {
|
||||
boolean result = true;
|
||||
Iterator<IntentionActionWithTextCaching> iterator = cachedActions.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
IntentionActionWithTextCaching cachedAction = iterator.next();
|
||||
IntentionAction action = cachedAction.getAction();
|
||||
if (!myFile.isValid() || !action.isAvailable(myProject, myEditor, myFile)) {
|
||||
Pair<PsiFile,Editor> place = ShowIntentionActionsHandler.availableFor(myFile, myEditor, action, element);
|
||||
if (place == null) {
|
||||
iterator.remove();
|
||||
result = false;
|
||||
}
|
||||
|
||||
+40
-6
@@ -39,6 +39,7 @@ import com.intellij.openapi.fileEditor.FileDocumentManager;
|
||||
import com.intellij.openapi.progress.ProgressIndicator;
|
||||
import com.intellij.openapi.progress.ProgressManager;
|
||||
import com.intellij.openapi.progress.Task;
|
||||
import com.intellij.openapi.project.IndexNotReadyException;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
@@ -50,6 +51,7 @@ import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
@@ -142,7 +144,10 @@ public class ShowIntentionActionsHandler implements CodeInsightActionHandler {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void chooseActionAndInvoke(PsiFile file, final Editor editor, final IntentionAction action, final String text) {
|
||||
// returns editor,file where the action is available or null if there are none
|
||||
@Nullable
|
||||
public static Pair<PsiFile, Editor> availableFor(PsiFile file, final Editor editor, final IntentionAction action, final PsiElement element) {
|
||||
if (!file.isValid()) return null;
|
||||
final Project project = file.getProject();
|
||||
|
||||
final Editor editorToApply;
|
||||
@@ -150,29 +155,58 @@ public class ShowIntentionActionsHandler implements CodeInsightActionHandler {
|
||||
|
||||
int offset = editor.getCaretModel().getOffset();
|
||||
PsiElement injected = InjectedLanguageManager.getInstance(project).findInjectedElementAt(file, offset);
|
||||
boolean inProject = file.getManager().isInProject(file);
|
||||
if (injected != null) {
|
||||
PsiFile injectedFile = injected.getContainingFile();
|
||||
Editor injectedEditor = InjectedLanguageUtil.getInjectedEditorForInjectedFile(editor, injectedFile);
|
||||
|
||||
if (action.isAvailable(project, injectedEditor, injectedFile)) {
|
||||
if (isAvailableHere(injectedEditor, injectedFile, injected, inProject, action)) {
|
||||
editorToApply = injectedEditor;
|
||||
fileToApply = injectedFile;
|
||||
}
|
||||
else if (!action.isAvailable(project, editor, file)) {
|
||||
return;
|
||||
else if (!isAvailableHere(editor, file, element, inProject, action)) {
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
editorToApply = editor;
|
||||
fileToApply = file;
|
||||
}
|
||||
}
|
||||
else if (!action.isAvailable(project, editor, file)) {
|
||||
return;
|
||||
else if (!isAvailableHere(editor, file, element, inProject, action)) {
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
editorToApply = editor;
|
||||
fileToApply = file;
|
||||
}
|
||||
return Pair.create(fileToApply, editorToApply);
|
||||
}
|
||||
|
||||
private static boolean isAvailableHere(Editor editor, PsiFile psiFile, PsiElement psiElement, boolean inProject, IntentionAction action) {
|
||||
try {
|
||||
Project project = psiFile.getProject();
|
||||
if (action instanceof PsiElementBaseIntentionAction) {
|
||||
if (!inProject || !((PsiElementBaseIntentionAction)action).isAvailable(project, editor, psiElement)) return false;
|
||||
}
|
||||
else if (!action.isAvailable(project, editor, psiFile)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (IndexNotReadyException e) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void chooseActionAndInvoke(PsiFile file, final Editor editor, final IntentionAction action, final String text) {
|
||||
final Project project = file.getProject();
|
||||
|
||||
int offset = editor.getCaretModel().getOffset();
|
||||
PsiElement element = file.findElementAt(offset);
|
||||
Pair<PsiFile, Editor> pair = availableFor(file, editor, action, element);
|
||||
if (pair == null) return;
|
||||
final Editor editorToApply = pair.second;
|
||||
final PsiFile fileToApply = pair.first;
|
||||
|
||||
Runnable runnable = new Runnable() {
|
||||
public void run() {
|
||||
|
||||
+2
-2
@@ -532,8 +532,8 @@ class TemplateListPanel extends JPanel {
|
||||
TemplateImpl orTemplate = getTemplate(selected);
|
||||
LOG.assertTrue(orTemplate != null);
|
||||
TemplateImpl template = orTemplate.copy();
|
||||
myTemplateOptions.put(getKey(template), template.createOptions());
|
||||
myTemplateContext.put(getKey(template), template.createContext());
|
||||
myTemplateOptions.put(getKey(template), getOptions(orTemplate));
|
||||
myTemplateContext.put(getKey(template), getContext(orTemplate));
|
||||
EditTemplateDialog dialog = new EditTemplateDialog(this, CodeInsightBundle.message("dialog.copy.live.template.title"), template, getTemplateGroups(),
|
||||
(String)myExpandByCombo.getSelectedItem(), getOptions(template), getContext(template));
|
||||
dialog.show();
|
||||
|
||||
+2
@@ -24,6 +24,7 @@ import com.intellij.openapi.help.HelpManager;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.DialogWrapper;
|
||||
import com.intellij.openapi.ui.TextFieldWithBrowseButton;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.psi.PsiDirectory;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
@@ -96,6 +97,7 @@ public class MoveFilesOrDirectoriesDialog extends DialogWrapper{
|
||||
validateOKButton();
|
||||
}
|
||||
});
|
||||
Disposer.register(getDisposable(), myTargetDirectoryField);
|
||||
|
||||
return panel;
|
||||
}
|
||||
|
||||
@@ -104,7 +104,8 @@ public class NotificationModel {
|
||||
|
||||
private LinkedList<Notification> filterNotifications(@NotNull PairFunction<Notification, Project, Boolean> filter) {
|
||||
final LinkedList<Notification> result = new LinkedList<Notification>();
|
||||
final HashSet<Map.Entry<Notification, Pair<Project, Boolean>>> entries = new HashSet<Map.Entry<Notification, Pair<Project, Boolean>>>(myNotifications.entrySet());
|
||||
final HashSet<Map.Entry<Notification, Pair<Project, Boolean>>> entries =
|
||||
new HashSet<Map.Entry<Notification, Pair<Project, Boolean>>>(myNotifications.entrySet());
|
||||
for (final Map.Entry<Notification, Pair<Project, Boolean>> entry : entries) {
|
||||
if (filter.fun(entry.getKey(), entry.getValue().first)) {
|
||||
result.addFirst(entry.getKey());
|
||||
@@ -183,4 +184,24 @@ public class NotificationModel {
|
||||
public boolean hasRead(PairFunction<Notification, Project, Boolean> filter) {
|
||||
return getUnreadCount(filter) < myNotifications.size();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public NotificationType getMaximumType(PairFunction<Notification, Project, Boolean> filter) {
|
||||
final LinkedList<Notification> notifications = filterNotifications(filter);
|
||||
NotificationType result = null;
|
||||
for (Notification notification : notifications) {
|
||||
if (NotificationType.ERROR == notification.getType()) {
|
||||
return NotificationType.ERROR;
|
||||
}
|
||||
|
||||
if (NotificationType.WARNING == notification.getType()) {
|
||||
result = NotificationType.WARNING;
|
||||
}
|
||||
else if (result == null && NotificationType.INFORMATION == notification.getType()) {
|
||||
result = NotificationType.INFORMATION;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -268,6 +268,11 @@ public class NotificationsManagerImpl extends NotificationsManager implements No
|
||||
return myModel.getByType(type, createFilter(project, false));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public NotificationType getMaximumType(@Nullable final Project project) {
|
||||
return myModel.getMaximumType(createFilter(project, false));
|
||||
}
|
||||
|
||||
public boolean hasUnread(@Nullable final Project project) {
|
||||
return myModel.hasUnread(createFilter(project, false));
|
||||
}
|
||||
|
||||
+18
-6
@@ -17,6 +17,7 @@ package com.intellij.notification.impl.ui;
|
||||
|
||||
import com.intellij.concurrency.JobScheduler;
|
||||
import com.intellij.notification.Notification;
|
||||
import com.intellij.notification.NotificationType;
|
||||
import com.intellij.notification.impl.*;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.popup.JBPopup;
|
||||
@@ -39,7 +40,9 @@ import java.util.concurrent.TimeUnit;
|
||||
public class NotificationComponent extends JLabel implements NotificationModelListener {
|
||||
private static final Icon EMPTY_ICON = IconLoader.getIcon("/ide/notifications.png");
|
||||
private static final Icon READ_ICON = IconLoader.getIcon("/ide/read_notifications.png");
|
||||
private static final Icon UNREAD_ICON = IconLoader.getIcon("/ide/unread_notifications.png");
|
||||
private static final Icon ERROR_ICON = IconLoader.getIcon("/ide/error_notifications.png");
|
||||
private static final Icon WARNING_ICON = IconLoader.getIcon("/ide/warning_notifications.png");
|
||||
private static final Icon INFO_ICON = IconLoader.getIcon("/ide/info_notifications.png");
|
||||
|
||||
private WeakReference<JBPopup> myPopupRef;
|
||||
|
||||
@@ -112,11 +115,20 @@ public class NotificationComponent extends JLabel implements NotificationModelLi
|
||||
final NotificationsManagerImpl manager = getManager();
|
||||
|
||||
Icon icon = EMPTY_ICON;
|
||||
if (manager.hasUnread(getProject())) {
|
||||
icon = UNREAD_ICON;
|
||||
}
|
||||
else if (manager.hasRead(getProject())) {
|
||||
icon = READ_ICON;
|
||||
final NotificationType maximumType = manager.getMaximumType(getProject());
|
||||
if (maximumType != null) {
|
||||
switch (maximumType) {
|
||||
case WARNING:
|
||||
icon = WARNING_ICON;
|
||||
break;
|
||||
case ERROR:
|
||||
icon = ERROR_ICON;
|
||||
break;
|
||||
case INFORMATION:
|
||||
default:
|
||||
icon = INFO_ICON;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
myCurrentIcon = new BlinkIconWrapper(icon, false);
|
||||
|
||||
@@ -884,6 +884,7 @@ public class ProjectManagerImpl extends ProjectManagerEx implements NamedJDOMExt
|
||||
fireProjectClosing(project);
|
||||
|
||||
myOpenProjects.remove(project);
|
||||
myChangedProjectFiles.remove(project);
|
||||
fireProjectClosed(project);
|
||||
|
||||
if (save) {
|
||||
|
||||
@@ -82,12 +82,14 @@ public class AWTUtilitiesWrapper {
|
||||
}
|
||||
|
||||
public static boolean isTranslucencySupported(Object kind) {
|
||||
if (translucencyClass == null) {
|
||||
return false;
|
||||
}
|
||||
if (!isTranslucencyAPISupported()) return false;
|
||||
return isSupported(mIsTranslucencySupported, kind);
|
||||
}
|
||||
|
||||
public static boolean isTranslucencyAPISupported() {
|
||||
return translucencyClass != null;
|
||||
}
|
||||
|
||||
public static boolean isTranslucencyCapable(GraphicsConfiguration gc) {
|
||||
return isSupported(mIsTranslucencyCapable, gc);
|
||||
}
|
||||
|
||||
@@ -226,7 +226,9 @@ public final class WindowManagerImpl extends WindowManagerEx implements Applicat
|
||||
}
|
||||
|
||||
private static boolean calcAlphaModelSupported() {
|
||||
if (AWTUtilitiesWrapper.isTranslucencySupported(AWTUtilitiesWrapper.TRANSLUCENT)) return true;
|
||||
if (AWTUtilitiesWrapper.isTranslucencyAPISupported()) {
|
||||
return AWTUtilitiesWrapper.isTranslucencySupported(AWTUtilitiesWrapper.TRANSLUCENT);
|
||||
}
|
||||
try {
|
||||
return WindowUtils.isWindowAlphaSupported();
|
||||
}
|
||||
|
||||
+4
@@ -23,6 +23,7 @@ import com.intellij.openapi.compiler.*;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.progress.ProgressIndicator;
|
||||
import com.intellij.openapi.project.DumbService;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.projectRoots.Sdk;
|
||||
import com.intellij.openapi.roots.CompilerModuleExtension;
|
||||
@@ -65,6 +66,9 @@ public abstract class AnnotationBasedInstrumentingCompiler implements ClassInstr
|
||||
final Project project = context.getProject();
|
||||
final Set<InstrumentationItem> result = new HashSet<InstrumentationItem>();
|
||||
final PsiSearchHelper searchHelper = PsiManager.getInstance(context.getProject()).getSearchHelper();
|
||||
|
||||
DumbService.getInstance(project).waitForSmartMode();
|
||||
|
||||
ApplicationManager.getApplication().runReadAction(new Runnable() {
|
||||
public void run() {
|
||||
final String[] names = getAnnotationNames(project);
|
||||
|
||||
+1
-41
@@ -25,47 +25,7 @@
|
||||
<root url="jar://$MODULE_DIR$/lib/maven-2.2.0-uber.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="file://$MODULE_DIR$/../../../../maven/maven-2.2/components/maven-toolchain/src/main/java" />
|
||||
<root url="file://$MODULE_DIR$/../../../../maven/maven-2.2/wagon/wagon-providers/wagon-file/src/main/java" />
|
||||
<root url="file://$MODULE_DIR$/../../../../maven/maven-2.2/components/maven-plugin-api/src/main/java" />
|
||||
<root url="file://$MODULE_DIR$/../../../../maven/maven-2.2/components/maven-reporting/maven-reporting-api/src/main/java" />
|
||||
<root url="file://$MODULE_DIR$/../../../../maven/maven-2.2/components/maven-plugin-registry/target/generated-sources/modello" />
|
||||
<root url="file://$MODULE_DIR$/../../../../maven/maven-2.2/components/maven-script/maven-script-beanshell/src/main/java" />
|
||||
<root url="file://$MODULE_DIR$/../../../../maven/maven-2.2/wagon/wagon-providers/wagon-http-shared/src/main/java" />
|
||||
<root url="file://$MODULE_DIR$/../../../../maven/maven-2.2/components/maven-settings/src/main/java" />
|
||||
<root url="file://$MODULE_DIR$/../../../../maven/maven-2.2/wagon/wagon-providers/wagon-ftp/src/main/java" />
|
||||
<root url="file://$MODULE_DIR$/../../../../maven/maven-2.2/wagon/wagon-providers/wagon-ssh/src/main/java" />
|
||||
<root url="file://$MODULE_DIR$/../../../../maven/maven-2.2/plexus/interpolation-1.11/src/main/java" />
|
||||
<root url="file://$MODULE_DIR$/../../../../maven/maven-2.2/wagon/wagon-providers/wagon-ssh-external/src/main/java" />
|
||||
<root url="file://$MODULE_DIR$/../../../../maven/maven-2.2/plexus/plexus-utils-1.5.15/src/main/java" />
|
||||
<root url="file://$MODULE_DIR$/../../../../maven/maven-2.2/components/maven-repository-metadata/target/generated-sources/modello" />
|
||||
<root url="file://$MODULE_DIR$/../../../../maven/maven-2.2/components/maven-profile/src/main/java" />
|
||||
<root url="file://$MODULE_DIR$/../../../../maven/maven-2.2/components/maven-plugin-registry/src/main/java" />
|
||||
<root url="file://$MODULE_DIR$/../../../../maven/maven-2.2/wagon/wagon-provider-test/src/main/java" />
|
||||
<root url="file://$MODULE_DIR$/../../../../maven/maven-2.2/components/maven-artifact/src/main/java" />
|
||||
<root url="file://$MODULE_DIR$/../../../../maven/maven-2.2/components/maven-artifact-manager/src/main/java" />
|
||||
<root url="file://$MODULE_DIR$/../../../../maven/maven-2.2/components/maven-compat/src/main/java" />
|
||||
<root url="file://$MODULE_DIR$/../../../../maven/maven-2.2/components/maven-profile/target/generated-sources/modello" />
|
||||
<root url="file://$MODULE_DIR$/../../../../maven/maven-2.2/components/maven-settings/target/generated-sources/modello" />
|
||||
<root url="file://$MODULE_DIR$/../../../../maven/maven-2.2/wagon/wagon-providers/wagon-http/src/main/java" />
|
||||
<root url="file://$MODULE_DIR$/../../../../maven/maven-2.2/components/maven-plugin-descriptor/target/generated-sources/modello" />
|
||||
<root url="file://$MODULE_DIR$/../../../../maven/maven-2.2/components/maven-project/src/main/java" />
|
||||
<root url="file://$MODULE_DIR$/../../../../maven/maven-2.2/wagon/wagon-providers/wagon-webdav-jackrabbit/src/main/java" />
|
||||
<root url="file://$MODULE_DIR$/../../../../maven/maven-2.2/components/maven-script/maven-script-ant/src/main/java" />
|
||||
<root url="file://$MODULE_DIR$/../../../../maven/maven-2.2/components/maven-plugin-descriptor/src/main/java" />
|
||||
<root url="file://$MODULE_DIR$/../../../../maven/maven-2.2/components/maven-plugin-parameter-documenter/target/generated-sources/modello" />
|
||||
<root url="file://$MODULE_DIR$/../../../../maven/maven-2.2/components/maven-toolchain/target/generated-sources/modello" />
|
||||
<root url="file://$MODULE_DIR$/../../../../maven/maven-2.2/components/maven-core/src/main/java" />
|
||||
<root url="file://$MODULE_DIR$/../../../../maven/maven-2.2/wagon/wagon-providers/wagon-ssh-common/src/main/java" />
|
||||
<root url="file://$MODULE_DIR$/../../../../maven/maven-2.2/plexus/plexus-container-default-1.0-alpha-9-stable-1/src/main/java" />
|
||||
<root url="file://$MODULE_DIR$/../../../../maven/maven-2.2/components/maven-model/target/generated-sources/modello" />
|
||||
<root url="file://$MODULE_DIR$/../../../../maven/maven-2.2/components/maven-error-diagnostics/src/main/java" />
|
||||
<root url="file://$MODULE_DIR$/../../../../maven/maven-2.2/wagon/wagon-provider-api/src/main/java" />
|
||||
<root url="file://$MODULE_DIR$/../../../../maven/maven-2.2/components/maven-monitor/src/main/java" />
|
||||
<root url="file://$MODULE_DIR$/../../../../maven/maven-2.2/wagon/wagon-providers/wagon-http-lightweight/src/main/java" />
|
||||
<root url="file://$MODULE_DIR$/../../../../maven/maven-2.2/wagon/wagon-providers/wagon-scm/src/main/java" />
|
||||
</SOURCES>
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library">
|
||||
|
||||
Reference in New Issue
Block a user