mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge remote branch 'origin/master'
This commit is contained in:
Generated
+4
-2
@@ -1,9 +1,11 @@
|
||||
<component name="libraryTable">
|
||||
<library name="XStream">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/lib/xstream.jar!/" />
|
||||
<root url="jar://$PROJECT_DIR$/lib/xstream-1.4.3.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
<SOURCES>
|
||||
<root url="jar://$PROJECT_DIR$/lib/src/xstream-1.4.3-src.zip!/xstream-1.4.3/xstream/src/java" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
@@ -625,7 +625,7 @@ def layout_core_upsource(String home, String target) {
|
||||
include(name: "cli-parser-1.1.jar")
|
||||
include(name: "jna.jar")
|
||||
include(name: "log4j.jar")
|
||||
include(name: "xstream.jar")
|
||||
include(name: "xstream-1.4.3.jar")
|
||||
include(name: "xpp3-1.1.4-min.jar")
|
||||
include(name: "jdom.jar")
|
||||
}
|
||||
|
||||
@@ -231,7 +231,7 @@ libraryLicense(name: "Xerces", version: "2.9.1", license: "Apache 2.0", url: "ht
|
||||
libraryLicense(name: "XML Commons (xml-apis.jar, resolver.jar)", version: "", license: "Apache 2.0, W3C Software License , public domain", url: "http://xml.apache.org/commons/", licenseUrl: "http://xml.apache.org/commons/licenses.html")
|
||||
libraryLicense(name: "XMLBeans", libraryName: "XmlBeans", version: "2.3.0", license: "Apache 2.0", url: "http://xmlbeans.apache.org/", licenseUrl: "http://svn.jetbrains.org/idea/Trunk/bundled/WebServices/resources/lib/xmlbeans-2.3.0/xmlbeans.LICENSE")
|
||||
libraryLicense(name: "XML-RPC", libraryName: "XmlRPC", version: "2.0", license: "Apache 2.0", url: "http://ws.apache.org/xmlrpc/xmlrpc2/", licenseUrl: "http://ws.apache.org/xmlrpc/xmlrpc2/license.html")
|
||||
libraryLicense(name: "XStream", version: "1.2.1", license: "BSD", url: "http://xstream.codehaus.org/", licenseUrl: "http://xstream.codehaus.org/license.html")
|
||||
libraryLicense(name: "XStream", version: "1.4.3", license: "BSD", url: "http://xstream.codehaus.org/", licenseUrl: "http://xstream.codehaus.org/license.html")
|
||||
libraryLicense(name: "YourKit Java Profiler", libraryName: "yjp-controller-api-redist.jar", version: "8.0.x", license: "link (commercial license)", url: "http://yourkit.com/", licenseUrl: "http://www.yourkit.com/purchase/license.html")
|
||||
libraryLicense(name: "protobuf", version: "2.3.0", license: "New BSD", url: "http://code.google.com/p/protobuf/", licenseUrl: "http://code.google.com/p/protobuf/source/browse/trunk/COPYING.txt?r=367")
|
||||
libraryLicense(name: "Netty", libraryName: "Netty", version: "3.5.8", license: "Apache 2.0", url: "http://netty.io", licenseUrl: "http://www.apache.org/licenses/LICENSE-2.0")
|
||||
|
||||
+4
@@ -20,6 +20,7 @@ import com.intellij.openapi.components.State;
|
||||
import com.intellij.openapi.components.Storage;
|
||||
import com.intellij.openapi.components.StoragePathMacros;
|
||||
import com.intellij.openapi.components.StorageScheme;
|
||||
import com.intellij.openapi.project.Project;
|
||||
|
||||
@State(
|
||||
name = "CompilerAPISettings",
|
||||
@@ -29,4 +30,7 @@ import com.intellij.openapi.components.StorageScheme;
|
||||
}
|
||||
)
|
||||
public class CompilerAPIConfiguration extends JavacConfiguration {
|
||||
public CompilerAPIConfiguration(Project project) {
|
||||
super(project);
|
||||
}
|
||||
}
|
||||
+10
-2
@@ -30,10 +30,18 @@ import org.jetbrains.jps.model.java.compiler.JpsJavaCompilerOptions;
|
||||
)
|
||||
public class JavacConfiguration implements PersistentStateComponent<JpsJavaCompilerOptions> {
|
||||
private final JpsJavaCompilerOptions mySettings = new JpsJavaCompilerOptions();
|
||||
private final Project myProject;
|
||||
|
||||
public JavacConfiguration(Project project) {
|
||||
myProject = project;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public JpsJavaCompilerOptions getState() {
|
||||
return mySettings;
|
||||
JpsJavaCompilerOptions state = new JpsJavaCompilerOptions();
|
||||
XmlSerializerUtil.copyBean(mySettings, state);
|
||||
state.ADDITIONAL_OPTIONS_STRING = PathMacroManager.getInstance(myProject).collapsePathsRecursively(state.ADDITIONAL_OPTIONS_STRING);
|
||||
return state;
|
||||
}
|
||||
|
||||
public void loadState(JpsJavaCompilerOptions state) {
|
||||
@@ -41,6 +49,6 @@ public class JavacConfiguration implements PersistentStateComponent<JpsJavaCompi
|
||||
}
|
||||
|
||||
public static JpsJavaCompilerOptions getOptions(Project project, Class<? extends JavacConfiguration> aClass) {
|
||||
return ServiceManager.getService(project, aClass).getState();
|
||||
return ServiceManager.getService(project, aClass).mySettings;
|
||||
}
|
||||
}
|
||||
@@ -25,11 +25,10 @@ import com.intellij.openapi.progress.util.ProgressIndicatorBase;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiReference;
|
||||
import com.intellij.usages.PsiElementUsageTarget;
|
||||
import com.intellij.usages.UsageContextPanel;
|
||||
import com.intellij.usages.UsageTarget;
|
||||
import com.intellij.usages.UsageView;
|
||||
import com.intellij.usages.UsageContextPanel;
|
||||
import com.intellij.usages.impl.UsageContextPanelBase;
|
||||
import com.intellij.usages.impl.UsageViewImpl;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -91,7 +90,7 @@ public class UsageContextCallHierarchyPanel extends UsageContextPanelBase {
|
||||
myBrowser = null;
|
||||
}
|
||||
if (element != null) {
|
||||
myBrowser = createPanel(element);
|
||||
myBrowser = createCallHierarchyPanel(element);
|
||||
if (myBrowser == null) {
|
||||
element = null;
|
||||
}
|
||||
@@ -113,19 +112,6 @@ public class UsageContextCallHierarchyPanel extends UsageContextPanelBase {
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static HierarchyBrowser createPanel(@NotNull PsiElement element) {
|
||||
PsiElement resolve;
|
||||
|
||||
HierarchyBrowser result = null;
|
||||
if (element instanceof PsiReference && (resolve = ((PsiReference)element).resolve()) != null) {
|
||||
result = createCallHierarchyPanel(resolve);
|
||||
}
|
||||
if (result == null) result = createCallHierarchyPanel(element);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static HierarchyBrowser createCallHierarchyPanel(@NotNull PsiElement element) {
|
||||
HierarchyProvider provider = LanguageCallHierarchy.INSTANCE.forLanguage(element.getLanguage());
|
||||
|
||||
+1
-1
@@ -119,7 +119,7 @@ public abstract class AbstractMemberResolveConverter extends ResolvingConverter<
|
||||
|
||||
public LocalQuickFix[] getQuickFixes(final ConvertContext context) {
|
||||
final String targetName = ((GenericValue)context.getInvocationElement()).getStringValue();
|
||||
if (targetName == null) return super.getQuickFixes(context);
|
||||
if (!JavaPsiFacade.getInstance(context.getProject()).getNameHelper().isIdentifier(targetName)) return super.getQuickFixes(context);
|
||||
final PsiClass targetClass = getTargetClass(context);
|
||||
if (targetClass == null) return super.getQuickFixes(context);
|
||||
final PropertyMemberType memberType = getMemberTypes(context)[0];
|
||||
|
||||
@@ -52,4 +52,7 @@ public interface JpsProject extends JpsCompositeElement, JpsReferenceableElement
|
||||
@NotNull String getName();
|
||||
|
||||
void setName(@NotNull String name);
|
||||
|
||||
@NotNull
|
||||
JpsModel getModel();
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ import org.jetbrains.jps.model.library.sdk.JpsSdkType;
|
||||
public class JpsGlobalImpl extends JpsRootElementBase<JpsGlobalImpl> implements JpsGlobal {
|
||||
private final JpsLibraryCollectionImpl myLibraryCollection;
|
||||
|
||||
public JpsGlobalImpl(JpsModel model, JpsEventDispatcher eventDispatcher) {
|
||||
public JpsGlobalImpl(@NotNull JpsModel model, JpsEventDispatcher eventDispatcher) {
|
||||
super(model, eventDispatcher);
|
||||
myLibraryCollection = new JpsLibraryCollectionImpl(myContainer.setChild(JpsLibraryRole.LIBRARIES_COLLECTION_ROLE));
|
||||
myContainer.setChild(JpsFileTypesConfigurationImpl.ROLE, new JpsFileTypesConfigurationImpl());
|
||||
|
||||
@@ -34,7 +34,7 @@ public class JpsProjectImpl extends JpsRootElementBase<JpsProjectImpl> implement
|
||||
private final JpsLibraryCollection myLibraryCollection;
|
||||
private String myName = "";
|
||||
|
||||
public JpsProjectImpl(JpsModel model, JpsEventDispatcher eventDispatcher) {
|
||||
public JpsProjectImpl(@NotNull JpsModel model, JpsEventDispatcher eventDispatcher) {
|
||||
super(model, eventDispatcher);
|
||||
myContainer.setChild(JpsModuleRole.MODULE_COLLECTION_ROLE);
|
||||
myContainer.setChild(EXTERNAL_REFERENCES_COLLECTION_ROLE);
|
||||
|
||||
@@ -12,7 +12,7 @@ public abstract class JpsRootElementBase<E extends JpsRootElementBase<E>> extend
|
||||
private final JpsModel myModel;
|
||||
private final JpsEventDispatcher myEventDispatcher;
|
||||
|
||||
protected JpsRootElementBase(JpsModel model, JpsEventDispatcher eventDispatcher) {
|
||||
protected JpsRootElementBase(@NotNull JpsModel model, JpsEventDispatcher eventDispatcher) {
|
||||
super();
|
||||
myModel = model;
|
||||
myEventDispatcher = eventDispatcher;
|
||||
@@ -29,8 +29,9 @@ public abstract class JpsRootElementBase<E extends JpsRootElementBase<E>> extend
|
||||
return myEventDispatcher;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected JpsModel getModel() {
|
||||
public JpsModel getModel() {
|
||||
return myModel;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -259,7 +259,7 @@ public class JpsProjectLoader extends JpsLoaderBase {
|
||||
}
|
||||
}
|
||||
}
|
||||
JpsFacetSerializer.loadFacets(module, JDomSerializationUtil.findComponent(moduleRoot, "FacetManager"), baseModulePath);
|
||||
JpsFacetSerializer.loadFacets(module, JDomSerializationUtil.findComponent(moduleRoot, "FacetManager"));
|
||||
return module;
|
||||
}
|
||||
|
||||
|
||||
+3
-5
@@ -27,14 +27,12 @@ public abstract class JpsFacetConfigurationSerializer<E extends JpsElement> {
|
||||
return myFacetTypeId;
|
||||
}
|
||||
|
||||
public E loadExtension(final Element configurationElement, final String facetName, JpsModule module,
|
||||
String baseModulePath, JpsElement parentFacet) {
|
||||
final E e = loadExtension(configurationElement, facetName, baseModulePath, parentFacet, module);
|
||||
public E loadExtension(final Element configurationElement, final String facetName, JpsModule module, JpsElement parentFacet) {
|
||||
final E e = loadExtension(configurationElement, facetName, parentFacet, module);
|
||||
return module.getContainer().setChild(myRole, e);
|
||||
}
|
||||
|
||||
protected abstract E loadExtension(@NotNull Element facetConfigurationElement, String name, String baseModulePath, JpsElement parent,
|
||||
JpsModule module);
|
||||
protected abstract E loadExtension(@NotNull Element facetConfigurationElement, String name, JpsElement parent, JpsModule module);
|
||||
|
||||
public boolean hasExtension(JpsModule module) {
|
||||
return module.getContainer().getChild(myRole) != null;
|
||||
|
||||
+7
-8
@@ -23,11 +23,11 @@ public class JpsFacetSerializer {
|
||||
@NonNls public static final String CONFIGURATION_TAG = "configuration";
|
||||
@NonNls public static final String NAME_ATTRIBUTE = "name";
|
||||
|
||||
public static void loadFacets(JpsModule module, @Nullable Element facetManagerElement, final String baseModulePath) {
|
||||
public static void loadFacets(JpsModule module, @Nullable Element facetManagerElement) {
|
||||
if (facetManagerElement == null) return;
|
||||
final FacetManagerState state = XmlSerializer.deserialize(facetManagerElement, FacetManagerState.class);
|
||||
if (state != null) {
|
||||
addFacets(module, state.getFacets(), null, baseModulePath);
|
||||
addFacets(module, state.getFacets(), null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,20 +43,19 @@ public class JpsFacetSerializer {
|
||||
XmlSerializer.serializeInto(managerState, facetManagerElement, new SkipDefaultValuesSerializationFilters());
|
||||
}
|
||||
|
||||
private static void addFacets(JpsModule module, List<FacetState> facets, @Nullable final JpsElement parentFacet,
|
||||
final String baseModulePath) {
|
||||
private static void addFacets(JpsModule module, List<FacetState> facets, @Nullable final JpsElement parentFacet) {
|
||||
for (FacetState facetState : facets) {
|
||||
final JpsFacetConfigurationSerializer<?> serializer = getModuleExtensionSerializer(facetState.getFacetType());
|
||||
if (serializer != null) {
|
||||
final JpsElement element = addExtension(module, serializer, facetState, parentFacet, baseModulePath);
|
||||
addFacets(module, facetState.getSubFacets(), element, baseModulePath);
|
||||
final JpsElement element = addExtension(module, serializer, facetState, parentFacet);
|
||||
addFacets(module, facetState.getSubFacets(), element);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static <E extends JpsElement> E addExtension(JpsModule module, JpsFacetConfigurationSerializer<E> serializer, FacetState facet,
|
||||
JpsElement parentFacet, final String baseModulePath) {
|
||||
return serializer.loadExtension(facet.getConfiguration(), facet.getName(), module, baseModulePath, parentFacet);
|
||||
JpsElement parentFacet) {
|
||||
return serializer.loadExtension(facet.getConfiguration(), facet.getName(), module, parentFacet);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -43,7 +43,7 @@ xbean.jar
|
||||
xerces.jar
|
||||
xmlrpc-2.0.jar
|
||||
xpp3-1.1.4-min.jar
|
||||
xstream.jar
|
||||
xstream-1.4.3.jar
|
||||
swingx-core-1.6.2.jar
|
||||
netty-3.5.8.Final.jar
|
||||
protobuf-2.4.1.jar
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 316 B |
Binary file not shown.
|
After Width: | Height: | Size: 501 B |
Binary file not shown.
|
After Width: | Height: | Size: 611 B |
Binary file not shown.
|
After Width: | Height: | Size: 576 B |
@@ -65,9 +65,20 @@ public class CutHandler extends EditorWriteActionHandler {
|
||||
if (!selectionModel.hasSelection()) return;
|
||||
}
|
||||
|
||||
int start = selectionModel.getSelectionStart();
|
||||
int end = selectionModel.getSelectionEnd();
|
||||
|
||||
EditorActionManager.getInstance().getActionHandler(IdeActions.ACTION_EDITOR_COPY).execute(editor, dataContext);
|
||||
|
||||
EditorModificationUtil.deleteSelectedText(editor);
|
||||
if (start != end) {
|
||||
// There is a possible case that 'sticky selection' is active. It's automatically removed on copying then, so, we explictly
|
||||
// remove the text.
|
||||
editor.getDocument().deleteString(start, end);
|
||||
}
|
||||
else {
|
||||
EditorModificationUtil.deleteSelectedText(editor);
|
||||
}
|
||||
|
||||
if (positionToRestore != null) {
|
||||
editor.getCaretModel().moveToVisualPosition(positionToRestore);
|
||||
}
|
||||
|
||||
@@ -97,10 +97,15 @@ public abstract class HierarchyBrowserBase extends SimpleToolWindowPanel impleme
|
||||
protected void appendActions(@NotNull DefaultActionGroup actionGroup, @Nullable String helpID) {
|
||||
actionGroup.add(myAutoScrollToSourceHandler.createToggleAction());
|
||||
actionGroup.add(ActionManager.getInstance().getAction(IdeActions.ACTION_EXPAND_ALL));
|
||||
if (myContent != null) { // sometimes there is no content to close, e.g. in usage view preview
|
||||
actionGroup.add(PinToolwindowTabAction.getPinAction());
|
||||
actionGroup.add(new CloseAction());
|
||||
}
|
||||
actionGroup.add(new PinToolwindowTabAction(){
|
||||
@Override
|
||||
public void update(AnActionEvent event) {
|
||||
super.update(event);
|
||||
// sometimes there is no content to close, e.g. in usage view preview
|
||||
event.getPresentation().setVisible(myContent != null);
|
||||
}
|
||||
});
|
||||
actionGroup.add(new CloseAction());
|
||||
if (helpID != null) {
|
||||
actionGroup.add(new ContextHelpAction(helpID));
|
||||
}
|
||||
@@ -162,7 +167,8 @@ public abstract class HierarchyBrowserBase extends SimpleToolWindowPanel impleme
|
||||
return list.toArray(new HierarchyNodeDescriptor[list.size()]);
|
||||
}
|
||||
|
||||
private PsiElement[] getSelectedElements() {
|
||||
@NotNull
|
||||
protected PsiElement[] getSelectedElements() {
|
||||
HierarchyNodeDescriptor[] descriptors = getSelectedDescriptors();
|
||||
ArrayList<PsiElement> elements = new ArrayList<PsiElement>();
|
||||
for (HierarchyNodeDescriptor descriptor : descriptors) {
|
||||
@@ -244,9 +250,14 @@ public abstract class HierarchyBrowserBase extends SimpleToolWindowPanel impleme
|
||||
}
|
||||
myContent.getManager().removeContent(myContent, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(AnActionEvent e) {
|
||||
e.getPresentation().setVisible(myContent != null);
|
||||
}
|
||||
}
|
||||
|
||||
protected void configureTree(Tree tree) {
|
||||
protected void configureTree(@NotNull Tree tree) {
|
||||
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
|
||||
tree.setToggleClickCount(-1);
|
||||
tree.setCellRenderer(new HierarchyNodeRenderer());
|
||||
|
||||
@@ -45,7 +45,6 @@ import com.intellij.pom.Navigatable;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.search.scope.packageSet.NamedScope;
|
||||
import com.intellij.psi.search.scope.packageSet.NamedScopesHolder;
|
||||
import com.intellij.psi.util.PsiUtilCore;
|
||||
import com.intellij.ui.ScrollPaneFactory;
|
||||
import com.intellij.ui.treeStructure.Tree;
|
||||
import com.intellij.util.Alarm;
|
||||
@@ -66,7 +65,6 @@ import java.util.*;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class HierarchyBrowserBaseEx extends HierarchyBrowserBase implements OccurenceNavigator {
|
||||
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.ide.hierarchy.HierarchyBrowserBaseEx");
|
||||
|
||||
@NonNls private static final String HELP_ID = "reference.toolWindows.hierarchy";
|
||||
@@ -463,16 +461,6 @@ public abstract class HierarchyBrowserBaseEx extends HierarchyBrowserBase implem
|
||||
return myCurrentViewType;
|
||||
}
|
||||
|
||||
private PsiElement[] getSelectedElements() {
|
||||
HierarchyNodeDescriptor[] descriptors = getSelectedDescriptors();
|
||||
ArrayList<PsiElement> elements = new ArrayList<PsiElement>();
|
||||
for (HierarchyNodeDescriptor descriptor : descriptors) {
|
||||
PsiElement element = getElementFromDescriptor(descriptor);
|
||||
if (element != null) elements.add(element);
|
||||
}
|
||||
return PsiUtilCore.toPsiElementArray(elements);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getData(final String dataId) {
|
||||
if (getBrowserDataKey().equals(dataId)) {
|
||||
@@ -641,7 +629,7 @@ public abstract class HierarchyBrowserBaseEx extends HierarchyBrowserBase implem
|
||||
}
|
||||
}
|
||||
|
||||
protected class RefreshAction extends com.intellij.ide.actions.RefreshAction {
|
||||
private class RefreshAction extends com.intellij.ide.actions.RefreshAction {
|
||||
public RefreshAction() {
|
||||
super(IdeBundle.message("action.refresh"), IdeBundle.message("action.refresh"), AllIcons.Actions.Refresh);
|
||||
}
|
||||
@@ -737,7 +725,6 @@ public abstract class HierarchyBrowserBaseEx extends HierarchyBrowserBase implem
|
||||
@Override
|
||||
public final void actionPerformed(final AnActionEvent e) {
|
||||
selectScope(myScopeType);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ public class PsiElementModuleRenderer extends DefaultListCellRenderer{
|
||||
}
|
||||
myText = module.getName();
|
||||
if (inTestSource) {
|
||||
setIcon(AllIcons.Nodes.TestSourceFolder);
|
||||
setIcon(AllIcons.Modules.TestSourceFolder);
|
||||
}
|
||||
else {
|
||||
setIcon(ModuleType.get(module).getIcon());
|
||||
|
||||
@@ -330,7 +330,7 @@ public class IdeEventQueue extends EventQueue {
|
||||
myCurrentEvent = e;
|
||||
|
||||
try {
|
||||
_dispatchEvent(e, true);
|
||||
_dispatchEvent(e, false);
|
||||
}
|
||||
catch (ProcessCanceledException pce) {
|
||||
throw pce;
|
||||
|
||||
@@ -37,6 +37,7 @@ public class RefreshAction extends AnAction implements DumbAware {
|
||||
super(text, description, icon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(AnActionEvent e) {
|
||||
// empty
|
||||
}
|
||||
|
||||
@@ -51,29 +51,30 @@ import java.util.List;
|
||||
|
||||
public abstract class ContentChooser<Data> extends DialogWrapper {
|
||||
private List<Data> myAllContents;
|
||||
private Editor myViewer;
|
||||
private Editor myViewer;
|
||||
|
||||
private final boolean myUseIdeaEditor;
|
||||
|
||||
private final JList myList;
|
||||
private final Splitter mySplitter;
|
||||
private final Project myProject;
|
||||
private final boolean myAllowMultipleSelections;
|
||||
private final Alarm myUpdateAlarm;
|
||||
private final JList myList;
|
||||
private final JBSplitter mySplitter;
|
||||
private final Project myProject;
|
||||
private final boolean myAllowMultipleSelections;
|
||||
private final Alarm myUpdateAlarm;
|
||||
private Icon myListEntryIcon = AllIcons.FileTypes.Text;
|
||||
|
||||
public ContentChooser(Project project, String title, boolean useIdeaEditor) {
|
||||
this(project, title, useIdeaEditor, false);
|
||||
}
|
||||
|
||||
|
||||
public ContentChooser(Project project, String title, boolean useIdeaEditor, boolean allowMultipleSelections) {
|
||||
super(project, true);
|
||||
myProject = project;
|
||||
myUseIdeaEditor = useIdeaEditor;
|
||||
myAllowMultipleSelections = allowMultipleSelections;
|
||||
myUpdateAlarm = new Alarm(getDisposable());
|
||||
mySplitter = new Splitter(true, 0.3f);
|
||||
myList = new JBList();
|
||||
mySplitter = new JBSplitter(true, 0.3f);
|
||||
mySplitter.setSplitterProportionKey(getDimensionServiceKey() + ".splitter");
|
||||
myList = new JBList();
|
||||
|
||||
setOKButtonText(CommonBundle.getOkButtonText());
|
||||
setTitle(title);
|
||||
|
||||
@@ -23,13 +23,15 @@ import com.intellij.openapi.wm.impl.content.ToolWindowContentUi;
|
||||
import com.intellij.ui.content.Content;
|
||||
import com.intellij.ui.content.ContentManager;
|
||||
import com.intellij.ui.content.TabbedPaneContentUI;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* @author spleaner
|
||||
*/
|
||||
public class PinToolwindowTabAction extends ToggleAction implements DumbAware {
|
||||
public static final String ACTION_NAME = "PinToolwindowTab";
|
||||
@NonNls public static final String ACTION_NAME = "PinToolwindowTab";
|
||||
|
||||
public static AnAction getPinAction() {
|
||||
return ActionManager.getInstance().getAction(ACTION_NAME);
|
||||
@@ -40,7 +42,7 @@ public class PinToolwindowTabAction extends ToggleAction implements DumbAware {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static Content getContextContent(AnActionEvent event) {
|
||||
private static Content getContextContent(@NotNull AnActionEvent event) {
|
||||
final ToolWindow window = PlatformDataKeys.TOOL_WINDOW.getData(event.getDataContext());
|
||||
if (window != null) {
|
||||
final ContentManager contentManager = window.getContentManager();
|
||||
@@ -52,16 +54,19 @@ public class PinToolwindowTabAction extends ToggleAction implements DumbAware {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelected(AnActionEvent event) {
|
||||
final Content content = getContextContent(event);
|
||||
return content != null && content.isPinned();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSelected(AnActionEvent event, boolean flag) {
|
||||
final Content content = getContextContent(event);
|
||||
if (content != null) content.setPinned(flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(AnActionEvent event) {
|
||||
super.update(event);
|
||||
Presentation presentation = event.getPresentation();
|
||||
|
||||
@@ -430,7 +430,7 @@ powered.by=Powered by
|
||||
powered.by.plugin=''{0}'' plugin.
|
||||
error.cannot.convert.default.message=Invalid value: ''{0}''
|
||||
error.cannot.resolve.default.message=Cannot resolve symbol ''{0}''
|
||||
error.cannot.resolve.0.1=Cannot resolve {0} {1}
|
||||
error.cannot.resolve.0.1=Cannot resolve {0} ''{1}''
|
||||
error.unknown.enum.value.message=Unknown enum value ''{0}''
|
||||
i18nize.cant.create.properties.file.because.its.name.is.associated=Can''t create properties file ''{0}'' because its name is associated with the {1}.
|
||||
i18nize.error.creating.properties.file=Error creating properties file
|
||||
|
||||
@@ -31,5 +31,7 @@ public abstract class PathMacroManager implements PathMacroSubstitutor {
|
||||
|
||||
public abstract void collapsePathsRecursively(Element element);
|
||||
|
||||
public abstract String collapsePathsRecursively(String text);
|
||||
|
||||
public abstract TrackingPathMacroSubstitutor createTrackingSubstitutor();
|
||||
}
|
||||
|
||||
+5
@@ -110,6 +110,11 @@ public class BasePathMacroManager extends PathMacroManager {
|
||||
getReplacePathMap().substitute(element, SystemInfo.isFileSystemCaseSensitive, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String collapsePathsRecursively(final String text) {
|
||||
return getReplacePathMap().substituteRecursively(text, SystemInfo.isFileSystemCaseSensitive);
|
||||
}
|
||||
|
||||
public void expandPaths(final Element element) {
|
||||
getExpandMacroMap().substitute(element, SystemInfo.isFileSystemCaseSensitive);
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.intellij.usages.impl.rules;
|
||||
|
||||
import com.intellij.icons.AllIcons;
|
||||
import com.intellij.openapi.roots.ProjectFileIndex;
|
||||
import com.intellij.openapi.roots.ProjectRootManager;
|
||||
import com.intellij.openapi.vcs.FileStatus;
|
||||
@@ -58,7 +59,7 @@ public class UsageScopeGroupingRule implements UsageGroupingRule {
|
||||
private static final UsageScopeGroup TEST = new UsageScopeGroup(0) {
|
||||
@Override
|
||||
public Icon getIcon(boolean isOpen) {
|
||||
return PlatformIcons.TEST_SOURCE_FOLDER;
|
||||
return AllIcons.Modules.TestSourceFolder;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -58,7 +58,7 @@ public class UnversionedViewDialog extends DialogWrapper {
|
||||
|
||||
public UnversionedViewDialog(final Project project) {
|
||||
super(project, true);
|
||||
setTitle("Unversioned files");
|
||||
setTitle("Unversioned Files");
|
||||
myProject = project;
|
||||
final Runnable closer = new Runnable() {
|
||||
public void run() {
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
<orderEntry type="library" name="NanoXML" level="project" />
|
||||
<orderEntry type="module" module-name="jps-model-api" />
|
||||
<orderEntry type="module" module-name="jps-model-serialization" />
|
||||
<orderEntry type="module" module-name="jps-model-impl" />
|
||||
</component>
|
||||
</module>
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jps.builders.storage.BuildDataPaths;
|
||||
import org.jetbrains.jps.model.serialization.JpsModelSerializationDataService;
|
||||
import org.jetbrains.jps.util.JpsPathUtil;
|
||||
import org.jetbrains.jps.ModuleChunk;
|
||||
import org.jetbrains.jps.ProjectPaths;
|
||||
@@ -35,6 +36,7 @@ import org.jetbrains.jps.model.JpsSimpleElement;
|
||||
import org.jetbrains.jps.model.java.JavaSourceRootType;
|
||||
import org.jetbrains.jps.model.java.JpsJavaClasspathKind;
|
||||
import org.jetbrains.jps.model.java.JpsJavaExtensionService;
|
||||
import org.jetbrains.jps.model.java.impl.JpsJavaDependenciesEnumerationHandler;
|
||||
import org.jetbrains.jps.model.library.JpsLibrary;
|
||||
import org.jetbrains.jps.model.library.JpsLibraryRoot;
|
||||
import org.jetbrains.jps.model.library.JpsOrderRootType;
|
||||
@@ -73,8 +75,9 @@ public class AndroidJpsUtil {
|
||||
}
|
||||
|
||||
private static boolean shouldProcessDependenciesRecursively(JpsModule module) {
|
||||
// todo: return false for mavenized modules
|
||||
return true;
|
||||
return JpsJavaDependenciesEnumerationHandler.shouldProcessDependenciesRecursively(
|
||||
JpsJavaDependenciesEnumerationHandler.createHandlers(
|
||||
Collections.singletonList(module)));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -575,8 +578,8 @@ public class AndroidJpsUtil {
|
||||
return new File(outputDirForPackagedArtifacts, getApkName(module)).getPath();
|
||||
}
|
||||
|
||||
final String moduleDirPath = extension.getBaseModulePath();
|
||||
return moduleDirPath != null ? FileUtil.toSystemDependentName(moduleDirPath + apkRelativePath) : null;
|
||||
File moduleBaseDirectory = JpsModelSerializationDataService.getBaseDirectory(module);
|
||||
return moduleBaseDirectory != null ? FileUtil.toSystemDependentName(moduleBaseDirectory.getAbsolutePath() + apkRelativePath) : null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
-2
@@ -60,8 +60,6 @@ public interface JpsAndroidModuleExtension extends JpsElement {
|
||||
|
||||
String getApkRelativePath();
|
||||
|
||||
String getBaseModulePath();
|
||||
|
||||
String getCustomDebugKeyStorePath();
|
||||
|
||||
List<AndroidNativeLibData> getAdditionalNativeLibs();
|
||||
|
||||
+1
-2
@@ -44,9 +44,8 @@ public class JpsAndroidModelSerializerExtension extends JpsModelSerializerExtens
|
||||
@Override
|
||||
public JpsAndroidModuleExtension loadExtension(@NotNull Element facetConfigurationElement,
|
||||
String name,
|
||||
String baseModulePath,
|
||||
JpsElement parent, JpsModule module) {
|
||||
return new JpsAndroidModuleExtensionImpl(XmlSerializer.deserialize(facetConfigurationElement, JpsAndroidModuleProperties.class), baseModulePath);
|
||||
return new JpsAndroidModuleExtensionImpl(XmlSerializer.deserialize(facetConfigurationElement, JpsAndroidModuleProperties.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+6
-11
@@ -20,6 +20,7 @@ import com.intellij.util.xmlb.XmlSerializerUtil;
|
||||
import org.jetbrains.android.util.AndroidNativeLibData;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jps.model.serialization.JpsModelSerializationDataService;
|
||||
import org.jetbrains.jps.util.JpsPathUtil;
|
||||
import org.jetbrains.jps.android.model.JpsAndroidModuleExtension;
|
||||
import org.jetbrains.jps.model.ex.JpsElementBase;
|
||||
@@ -37,11 +38,9 @@ import java.util.List;
|
||||
public class JpsAndroidModuleExtensionImpl extends JpsElementBase<JpsAndroidModuleExtensionImpl> implements JpsAndroidModuleExtension {
|
||||
public static final JpsElementChildRoleBase<JpsAndroidModuleExtension> KIND = JpsElementChildRoleBase.create("android extension");
|
||||
private final JpsAndroidModuleProperties myProperties;
|
||||
private final String myBaseModulePath;
|
||||
|
||||
public JpsAndroidModuleExtensionImpl(JpsAndroidModuleProperties properties, String baseModulePath) {
|
||||
public JpsAndroidModuleExtensionImpl(JpsAndroidModuleProperties properties) {
|
||||
myProperties = properties;
|
||||
myBaseModulePath = baseModulePath;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -52,7 +51,7 @@ public class JpsAndroidModuleExtensionImpl extends JpsElementBase<JpsAndroidModu
|
||||
@NotNull
|
||||
@Override
|
||||
public JpsAndroidModuleExtensionImpl createCopy() {
|
||||
return new JpsAndroidModuleExtensionImpl(XmlSerializerUtil.createCopy(myProperties), myBaseModulePath);
|
||||
return new JpsAndroidModuleExtensionImpl(XmlSerializerUtil.createCopy(myProperties));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -61,11 +60,6 @@ public class JpsAndroidModuleExtensionImpl extends JpsElementBase<JpsAndroidModu
|
||||
fireElementChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBaseModulePath() {
|
||||
return myBaseModulePath;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCustomDebugKeyStorePath() {
|
||||
return JpsPathUtil.urlToPath(myProperties.CUSTOM_DEBUG_KEYSTORE_PATH);
|
||||
@@ -145,8 +139,9 @@ public class JpsAndroidModuleExtensionImpl extends JpsElementBase<JpsAndroidModu
|
||||
}
|
||||
|
||||
final JpsModule module = getModule();
|
||||
if (myBaseModulePath != null) {
|
||||
String absPath = FileUtil.toSystemDependentName(myBaseModulePath + relativePath);
|
||||
File moduleBaseDir = JpsModelSerializationDataService.getBaseDirectory(module);
|
||||
if (moduleBaseDir != null) {
|
||||
String absPath = FileUtil.toSystemDependentName(moduleBaseDir.getAbsolutePath() + relativePath);
|
||||
File f = new File(absPath);
|
||||
|
||||
if (f.exists()) {
|
||||
|
||||
@@ -15,16 +15,18 @@
|
||||
*/
|
||||
package org.jetbrains.android.fileTypes;
|
||||
|
||||
import com.intellij.openapi.fileTypes.FileTypeFactory;
|
||||
import com.intellij.openapi.fileTypes.FileTypeConsumer;
|
||||
import com.intellij.openapi.fileTypes.FileTypeFactory;
|
||||
import com.intellij.openapi.fileTypes.PlainTextFileType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
*/
|
||||
public class AndroidFileTypeFactory extends FileTypeFactory {
|
||||
public void createFileTypes(@NotNull FileTypeConsumer fileTypeConsumer) {
|
||||
fileTypeConsumer.consume(AndroidIdlFileType.ourFileType, AndroidIdlFileType.DEFAULT_ASSOCIATED_EXTENSION);
|
||||
fileTypeConsumer.consume(AndroidRenderscriptFileType.INSTANCE, AndroidRenderscriptFileType.DEFAULT_EXTENSION);
|
||||
public void createFileTypes(@NotNull FileTypeConsumer consumer) {
|
||||
consumer.consume(AndroidIdlFileType.ourFileType, AndroidIdlFileType.DEFAULT_ASSOCIATED_EXTENSION);
|
||||
consumer.consume(AndroidRenderscriptFileType.INSTANCE, AndroidRenderscriptFileType.DEFAULT_EXTENSION);
|
||||
consumer.consume(PlainTextFileType.INSTANCE, "rsh");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ import java.util.regex.Pattern;
|
||||
*/
|
||||
public abstract class AndroidLogFilterModel extends LogFilterModel {
|
||||
static final Pattern ANDROID_LOG_MESSAGE_PATTERN =
|
||||
Pattern.compile("\\d\\d-\\d\\d\\s\\d\\d:\\d\\d:\\d\\d\\.\\d+:\\s+[A-Z]+/([\\S ]+)\\((\\d+)\\):(.*)");
|
||||
Pattern.compile("\\d\\d-\\d\\d\\s\\d\\d:\\d\\d:\\d\\d\\.\\d+:\\s+([A-Z]+)/([\\S ]+)\\((\\d+)\\):(.*)");
|
||||
|
||||
private final List<LogFilterListener> myListeners = new ArrayList<LogFilterListener>();
|
||||
|
||||
@@ -138,6 +138,7 @@ public abstract class AndroidLogFilterModel extends LogFilterModel {
|
||||
}
|
||||
|
||||
|
||||
Log.LogLevel logLevel = null;
|
||||
String tag = null;
|
||||
String pid = null;
|
||||
String message = text;
|
||||
@@ -145,16 +146,21 @@ public abstract class AndroidLogFilterModel extends LogFilterModel {
|
||||
final Matcher matcher = ANDROID_LOG_MESSAGE_PATTERN.matcher(text);
|
||||
if (matcher.matches()) {
|
||||
String s = matcher.group(1).trim();
|
||||
if (s.length() > 0) {
|
||||
logLevel = getLogLevel(s);
|
||||
}
|
||||
|
||||
s = matcher.group(2).trim();
|
||||
if (s.length() > 0) {
|
||||
tag = s;
|
||||
}
|
||||
|
||||
s = matcher.group(2).trim();
|
||||
s = matcher.group(3).trim();
|
||||
if (s.length() > 0) {
|
||||
pid = s;
|
||||
}
|
||||
|
||||
s = matcher.group(3).trim();
|
||||
s = matcher.group(4).trim();
|
||||
if (s.length() > 0) {
|
||||
message = s;
|
||||
}
|
||||
@@ -167,8 +173,10 @@ public abstract class AndroidLogFilterModel extends LogFilterModel {
|
||||
if (pid == null) {
|
||||
pid = myPrevPid;
|
||||
}
|
||||
|
||||
return configuredFilterName.isApplicable(message, tag, pid, getLogLevel(text));
|
||||
if (logLevel == null) {
|
||||
logLevel = myPrevMessageLogLevel;
|
||||
}
|
||||
return configuredFilterName.isApplicable(message, tag, pid, logLevel);
|
||||
}
|
||||
|
||||
public List<? extends LogFilter> getLogFilters() {
|
||||
@@ -185,18 +193,27 @@ public abstract class AndroidLogFilterModel extends LogFilterModel {
|
||||
|
||||
@Override
|
||||
public boolean isAcceptable(String line) {
|
||||
Log.LogLevel logLevel = getLogLevel(line);
|
||||
final Matcher matcher = ANDROID_LOG_MESSAGE_PATTERN.matcher(line);
|
||||
Log.LogLevel logLevel = null;
|
||||
|
||||
if (matcher.matches()) {
|
||||
logLevel = getLogLevel(matcher.group(1));
|
||||
}
|
||||
if (logLevel == null) {
|
||||
logLevel = myPrevMessageLogLevel;
|
||||
}
|
||||
return logLevel != null && logLevel.getPriority() >= myLogLevel.getPriority();
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
Log.LogLevel getLogLevel(String line) {
|
||||
Log.LogLevel logLevel = AndroidLogcatUtil.getLogLevel(line);
|
||||
if (logLevel == null) {
|
||||
logLevel = myPrevMessageLogLevel;
|
||||
private static Log.LogLevel getLogLevel(@NotNull String name) {
|
||||
for (Log.LogLevel level : Log.LogLevel.values()) {
|
||||
if (name.equals(level.name())) {
|
||||
return level;
|
||||
}
|
||||
}
|
||||
return logLevel;
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isFilterSelected(LogFilter filter) {
|
||||
@@ -226,24 +243,24 @@ public abstract class AndroidLogFilterModel extends LogFilterModel {
|
||||
final boolean messageHeader = matcher.matches();
|
||||
|
||||
if (messageHeader) {
|
||||
String s = matcher.group(1).trim();
|
||||
String s = matcher.group(1);
|
||||
if (s.length() > 0) {
|
||||
final Log.LogLevel logLevel = getLogLevel(s);
|
||||
if (logLevel != null) {
|
||||
myPrevMessageLogLevel = logLevel;
|
||||
}
|
||||
}
|
||||
|
||||
s = matcher.group(2).trim();
|
||||
if (s.length() > 0) {
|
||||
myPrevTag = s;
|
||||
}
|
||||
|
||||
s = matcher.group(2).trim();
|
||||
s = matcher.group(3).trim();
|
||||
if (s.length() > 0) {
|
||||
myPrevPid = s;
|
||||
}
|
||||
}
|
||||
|
||||
Log.LogLevel logLevel = AndroidLogcatUtil.getLogLevel(line);
|
||||
if (logLevel != null) {
|
||||
myPrevMessageLogLevel = logLevel;
|
||||
}
|
||||
final Key key = myPrevMessageLogLevel != null ? getProcessOutputType(myPrevMessageLogLevel) : ProcessOutputTypes.STDOUT;
|
||||
|
||||
|
||||
final boolean applicable = isApplicable(line);
|
||||
final boolean applicableByCustomFilter = isApplicableByCustomFilter(line);
|
||||
|
||||
@@ -266,6 +283,7 @@ public abstract class AndroidLogFilterModel extends LogFilterModel {
|
||||
myFullMessageApplicable = myFullMessageApplicable || applicable;
|
||||
myFullMessageApplicableByCustomFilter = myFullMessageApplicableByCustomFilter || applicableByCustomFilter;
|
||||
}
|
||||
final Key key = myPrevMessageLogLevel != null ? getProcessOutputType(myPrevMessageLogLevel) : ProcessOutputTypes.STDOUT;
|
||||
|
||||
return new MyProcessingResult(key,
|
||||
myFullMessageApplicable && myFullMessageApplicableByCustomFilter,
|
||||
|
||||
@@ -45,36 +45,21 @@ import java.util.Map;
|
||||
*/
|
||||
public class AndroidLogcatUtil {
|
||||
private static final Logger LOG = Logger.getInstance("#org.jetbrains.android.run.AndroidDebugRunner");
|
||||
private static Map<String, Log.LogLevel> LOG_LEVELS;
|
||||
private static int minLogLevelNameLength;
|
||||
private static int maxLogLevelNameLength;
|
||||
private static Map<String, Log.LogLevel> ourLogLevels;
|
||||
|
||||
private AndroidLogcatUtil() {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public synchronized static Log.LogLevel getLogLevel(String message) {
|
||||
if (LOG_LEVELS == null) {
|
||||
LOG_LEVELS = new HashMap<String, Log.LogLevel>();
|
||||
public synchronized static Log.LogLevel getLogLevel(String s) {
|
||||
if (ourLogLevels == null) {
|
||||
ourLogLevels = new HashMap<String, Log.LogLevel>();
|
||||
|
||||
for (Log.LogLevel level : Log.LogLevel.values()) {
|
||||
String name = level.name();
|
||||
if (minLogLevelNameLength == 0 || name.length() < minLogLevelNameLength) {
|
||||
minLogLevelNameLength = name.length();
|
||||
}
|
||||
if (name.length() > maxLogLevelNameLength) {
|
||||
maxLogLevelNameLength = name.length();
|
||||
}
|
||||
LOG_LEVELS.put(name, level);
|
||||
ourLogLevels.put(level.name(), level);
|
||||
}
|
||||
}
|
||||
for (int i = 0, n = message.length(); i < n; i++) {
|
||||
for (int j = i + minLogLevelNameLength; j <= i + maxLogLevelNameLength && j < n; j++) {
|
||||
String s = message.substring(i, j);
|
||||
Log.LogLevel logLevel = LOG_LEVELS.get(s);
|
||||
if (logLevel != null) return logLevel;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
return ourLogLevels.get(s);
|
||||
}
|
||||
|
||||
private static void startLogging(IDevice device, AndroidOutputReceiver receiver)
|
||||
|
||||
@@ -143,12 +143,12 @@ class EditLogFilterDialog extends DialogWrapper {
|
||||
continue;
|
||||
}
|
||||
|
||||
final String tag = matcher.group(1).trim();
|
||||
final String tag = matcher.group(2).trim();
|
||||
if (tag != null && tag.length() > 0) {
|
||||
tagSet.add(tag);
|
||||
}
|
||||
|
||||
final String pid = matcher.group(2).trim();
|
||||
final String pid = matcher.group(3).trim();
|
||||
if (pid != null && pid.length() > 0) {
|
||||
try {
|
||||
Integer.parseInt(pid);
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package org.jetbrains.android.sdk;
|
||||
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.DialogWrapper;
|
||||
import com.intellij.ui.CollectionComboBoxModel;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Eugene.Kudelevsky
|
||||
*/
|
||||
public class AndroidNewSdkDialog extends DialogWrapper {
|
||||
private JPanel myContentPanel;
|
||||
private JComboBox myInternalJdkComboBox;
|
||||
private JComboBox myBuildTargetComboBox;
|
||||
|
||||
protected AndroidNewSdkDialog(@Nullable Project project,
|
||||
@NotNull List<String> javaSdkNames,
|
||||
@NotNull String selectedJavaSdkName,
|
||||
@NotNull List<String> targetNames,
|
||||
@NotNull String selectedTargetName) {
|
||||
super(project);
|
||||
setTitle("Create New Android SDK");
|
||||
myInternalJdkComboBox.setModel(new CollectionComboBoxModel(javaSdkNames, selectedJavaSdkName));
|
||||
myBuildTargetComboBox.setModel(new CollectionComboBoxModel(targetNames, selectedTargetName));
|
||||
|
||||
init();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
protected JComponent createCenterPanel() {
|
||||
return myContentPanel;
|
||||
}
|
||||
|
||||
public int getSelectedJavaSdkIndex() {
|
||||
return myInternalJdkComboBox.getSelectedIndex();
|
||||
}
|
||||
|
||||
public int getSelectedTargetIndex() {
|
||||
return myBuildTargetComboBox.getSelectedIndex();
|
||||
}
|
||||
}
|
||||
+8
-3
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="org.jetbrains.android.sdk.AndroidSdkConfigurableForm">
|
||||
<grid id="27dc6" binding="myContentPanel" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="org.jetbrains.android.sdk.AndroidNewSdkDialog">
|
||||
<grid id="27dc6" binding="myContentPanel" layout-manager="GridLayoutManager" row-count="3" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<xy x="20" y="20" width="500" height="68"/>
|
||||
<xy x="20" y="20" width="500" height="77"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
@@ -38,6 +38,11 @@
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<vspacer id="d5308">
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</vspacer>
|
||||
</children>
|
||||
</grid>
|
||||
</form>
|
||||
@@ -20,7 +20,6 @@ import com.android.sdklib.IAndroidTarget;
|
||||
import com.intellij.CommonBundle;
|
||||
import com.intellij.openapi.projectRoots.*;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import icons.AndroidIcons;
|
||||
import org.jdom.Element;
|
||||
import org.jetbrains.android.util.AndroidBundle;
|
||||
@@ -30,6 +29,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -102,17 +102,6 @@ public class AndroidSdkType extends SdkType implements JavaSdkType {
|
||||
return false;
|
||||
}
|
||||
|
||||
int choice = Messages
|
||||
.showChooseDialog("Please select Java SDK", "Select Internal Java Platform", ArrayUtil.toStringArray(javaSdks), javaSdks.get(0),
|
||||
Messages.getQuestionIcon());
|
||||
|
||||
if (choice == -1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final String name = javaSdks.get(choice);
|
||||
final Sdk jdk = sdkModel.findSdk(name);
|
||||
|
||||
MessageBuildingSdkLog log = new MessageBuildingSdkLog();
|
||||
AndroidSdkData sdkData = AndroidSdkData.parse(sdk.getHomePath(), log);
|
||||
|
||||
@@ -144,16 +133,17 @@ public class AndroidSdkType extends SdkType implements JavaSdkType {
|
||||
}
|
||||
}
|
||||
|
||||
choice =
|
||||
Messages.showChooseDialog("Select build target", "Create New Android SDK", targetNames,
|
||||
newestPlatform != null ? newestPlatform : targetNames[0], Messages.getQuestionIcon());
|
||||
final AndroidNewSdkDialog dialog =
|
||||
new AndroidNewSdkDialog(null, javaSdks, javaSdks.get(0), Arrays.asList(targetNames),
|
||||
newestPlatform != null ? newestPlatform : targetNames[0]);
|
||||
dialog.show();
|
||||
|
||||
if (choice == -1) {
|
||||
if (!dialog.isOK()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
AndroidSdkUtils.setUpSdk(sdk, jdk, sdks, targets[choice], true);
|
||||
|
||||
final String name = javaSdks.get(dialog.getSelectedJavaSdkIndex());
|
||||
final Sdk jdk = sdkModel.findSdk(name);
|
||||
AndroidSdkUtils.setUpSdk(sdk, jdk, sdks, targets[dialog.getSelectedTargetIndex()], true);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ public class AndroidTargetData {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public RenderServiceFactory getRenderServiceFactory(@NotNull Project project) throws RenderingException, IOException {
|
||||
public synchronized RenderServiceFactory getRenderServiceFactory(@NotNull Project project) throws RenderingException, IOException {
|
||||
if (myRenderServiceFactory == null) {
|
||||
final AttributeDefinitionsImpl attrDefs = getAttrDefsImpl(project);
|
||||
if (attrDefs == null) {
|
||||
|
||||
@@ -179,7 +179,7 @@ public class RenderUtil {
|
||||
|
||||
reportMissingClassesWarning(warnMessages, callback.getMissingClasses());
|
||||
|
||||
reportBrokenClassesWarning(warnMessages, callback.getBrokenClasses());
|
||||
reportBrokenClassesWarning(project, warnMessages, callback.getBrokenClasses());
|
||||
|
||||
final Result result = session.getResult();
|
||||
if (!result.isSuccess()) {
|
||||
@@ -232,21 +232,33 @@ public class RenderUtil {
|
||||
return projectResources;
|
||||
}
|
||||
|
||||
private static void reportBrokenClassesWarning(@NotNull List<FixableIssueMessage> warnMessages,
|
||||
private static void reportBrokenClassesWarning(@NotNull final Project project,
|
||||
@NotNull List<FixableIssueMessage> warnMessages,
|
||||
@NotNull Map<String, Throwable> brokenClasses) {
|
||||
if (brokenClasses.size() > 0) {
|
||||
final StringBuilder builder = new StringBuilder();
|
||||
|
||||
if (brokenClasses.size() > 1) {
|
||||
final StringBuilder builder = new StringBuilder();
|
||||
builder.append("Unable to initialize:\n");
|
||||
for (String brokenClass : brokenClasses.keySet()) {
|
||||
builder.append(" ").append(brokenClass).append('\n');
|
||||
|
||||
for (Map.Entry<String, Throwable> entry : brokenClasses.entrySet()) {
|
||||
builder.append(" ").append(entry.getKey()).append('\n');
|
||||
}
|
||||
removeLastNewLineChar(builder);
|
||||
// todo: show stack traces
|
||||
warnMessages.add(new FixableIssueMessage(builder.toString()));
|
||||
}
|
||||
else {
|
||||
builder.append("Unable to initialize ").append(brokenClasses.keySet().iterator().next());
|
||||
final Map.Entry<String, Throwable> entry = brokenClasses.entrySet().iterator().next();
|
||||
@SuppressWarnings("ThrowableResultOfMethodCallIgnored")
|
||||
final Throwable t = entry.getValue();
|
||||
warnMessages.add(new FixableIssueMessage("Unable to initialize " + entry.getKey() + ' ', "Details", "", new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
AndroidUtils.showStackStace(project, new Throwable[] {t});
|
||||
}
|
||||
}));
|
||||
}
|
||||
removeLastNewLineChar(builder);
|
||||
warnMessages.add(new FixableIssueMessage(builder.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+7
-22
@@ -23,10 +23,9 @@ import org.jdom.Element;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.idea.eclipse.*;
|
||||
import org.jetbrains.jps.model.JpsElementFactory;
|
||||
import org.jetbrains.jps.model.JpsModel;
|
||||
import org.jetbrains.jps.model.JpsProject;
|
||||
import org.jetbrains.jps.model.java.*;
|
||||
import org.jetbrains.jps.model.library.JpsLibrary;
|
||||
import org.jetbrains.jps.model.library.JpsLibraryReference;
|
||||
import org.jetbrains.jps.model.library.JpsOrderRootType;
|
||||
import org.jetbrains.jps.model.module.*;
|
||||
import org.jetbrains.jps.model.serialization.JpsMacroExpander;
|
||||
@@ -67,11 +66,10 @@ class JpsEclipseClasspathReader extends AbstractEclipseClasspathReader<JpsModule
|
||||
boolean exported,
|
||||
String name,
|
||||
boolean applicationLevel) {
|
||||
JpsLibrary lib = findLibraryByName(rootModel.getProject(), name);
|
||||
if (lib != null) {
|
||||
final JpsLibraryDependency dependency = rootModel.getDependenciesList().addLibraryDependency(lib);
|
||||
setLibraryEntryExported(exported, dependency);
|
||||
}
|
||||
JpsElementFactory factory = JpsElementFactory.getInstance();
|
||||
JpsLibraryReference libraryReference = factory.createLibraryReference(name, applicationLevel ? factory.createGlobalReference() : factory.createProjectReference());
|
||||
final JpsLibraryDependency dependency = rootModel.getDependenciesList().addLibraryDependency(libraryReference);
|
||||
setLibraryEntryExported(dependency, exported);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -160,7 +158,7 @@ class JpsEclipseClasspathReader extends AbstractEclipseClasspathReader<JpsModule
|
||||
}
|
||||
jpsLibrary.addRoot(url, JpsOrderRootType.COMPILED);
|
||||
|
||||
setLibraryEntryExported(exported, dependency);
|
||||
setLibraryEntryExported(dependency, exported);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -239,24 +237,11 @@ class JpsEclipseClasspathReader extends AbstractEclipseClasspathReader<JpsModule
|
||||
extension.setInheritOutput(false);
|
||||
}
|
||||
|
||||
private static void setLibraryEntryExported(boolean exported,
|
||||
final JpsDependencyElement dependency) {
|
||||
private static void setLibraryEntryExported(final JpsDependencyElement dependency, boolean exported) {
|
||||
final JpsJavaDependencyExtension extension = getService().getOrCreateDependencyExtension(dependency);
|
||||
extension.setExported(exported);
|
||||
}
|
||||
|
||||
|
||||
public static JpsLibrary findLibraryByName(JpsProject project, String name) {
|
||||
JpsLibrary lib = project.getLibraryCollection().findLibrary(name);
|
||||
if (lib == null) {
|
||||
final JpsModel model = JpsElementFactory.getInstance().createModel();
|
||||
lib = model.getGlobal().getLibraryCollection().findLibrary(name);
|
||||
}
|
||||
|
||||
return lib;
|
||||
}
|
||||
|
||||
|
||||
private static JpsJavaExtensionService getService() {
|
||||
return JpsJavaExtensionService.getInstance();
|
||||
}
|
||||
|
||||
+1
-1
@@ -338,7 +338,7 @@ public class Maven3ServerEmbedderImpl extends MavenRemoteObject implements Maven
|
||||
|
||||
project.setArtifacts(result.getArtifacts());
|
||||
// end copied from DefaultMavenProjectBuilder.buildWithDependencies
|
||||
ref.set(new MavenExecutionResult(project, new ArrayList<Exception>()));
|
||||
ref.set(new MavenExecutionResult(project, result.getExceptions()));
|
||||
}
|
||||
catch (Exception e) {
|
||||
ref.set(handleException(e));
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ public class PaletteGroupComponent extends JCheckBox {
|
||||
setText(group.getName());
|
||||
setSelected(true);
|
||||
setIcon(AllIcons.Nodes.TreeClosed);
|
||||
setSelectedIcon(AllIcons.Nodes.TreeOpen);
|
||||
setSelectedIcon(AllIcons.Nodes.Folder);
|
||||
setFont(getFont().deriveFont(Font.BOLD));
|
||||
setFocusPainted(false);
|
||||
setMargin(new Insets(0, 3, 0, 3));
|
||||
|
||||
+5
-3
@@ -96,7 +96,9 @@ public class XsltExtractTemplateAction extends XsltRefactoringActionBase {
|
||||
if (start == null || end == null) {
|
||||
return false;
|
||||
}
|
||||
if (!(start.getParent() instanceof XmlTag)) {
|
||||
|
||||
final PsiElement parent = start.getParent();
|
||||
if (!(parent instanceof XmlTag || parent instanceof XmlComment)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -114,7 +116,7 @@ public class XsltExtractTemplateAction extends XsltRefactoringActionBase {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
final XmlTag startTag = PsiTreeUtil.getParentOfType(start, XmlTag.class);
|
||||
final XmlElement startTag = PsiTreeUtil.getParentOfType(start, XmlTag.class, XmlComment.class);
|
||||
if (startTag == null) {
|
||||
return false;
|
||||
}
|
||||
@@ -122,7 +124,7 @@ public class XsltExtractTemplateAction extends XsltRefactoringActionBase {
|
||||
return false;
|
||||
}
|
||||
|
||||
final XmlTag endTag = PsiTreeUtil.getParentOfType(end, XmlTag.class);
|
||||
final XmlElement endTag = PsiTreeUtil.getParentOfType(end, XmlTag.class, XmlComment.class);
|
||||
if (endTag == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -49,6 +49,10 @@ public class XsltRefactoringTest extends TestBase {
|
||||
doExtractTemplate();
|
||||
}
|
||||
|
||||
public void testExtractTemplateWithComment() throws Throwable {
|
||||
doExtractTemplate();
|
||||
}
|
||||
|
||||
public void testExtractTemplateOneVar() throws Throwable {
|
||||
doExtractTemplate();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
|
||||
<xsl:template match="/">
|
||||
<selection><!-- comment -->
|
||||
<foo /></selection>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
|
||||
<xsl:template match="/">
|
||||
<xsl:call-template name="foo" />
|
||||
</xsl:template>
|
||||
<xsl:template name="foo">
|
||||
<!-- comment -->
|
||||
<foo />
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
Reference in New Issue
Block a user