diff --git a/platform/lang-impl/src/com/intellij/ide/projectView/impl/ProjectViewTree.java b/platform/lang-impl/src/com/intellij/ide/projectView/impl/ProjectViewTree.java index 124e7ae11b42..98de9e954a42 100644 --- a/platform/lang-impl/src/com/intellij/ide/projectView/impl/ProjectViewTree.java +++ b/platform/lang-impl/src/com/intellij/ide/projectView/impl/ProjectViewTree.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -45,6 +45,7 @@ public abstract class ProjectViewTree extends DnDAwareTree { cellRenderer.setOpaque(false); cellRenderer.setIconOpaque(false); setCellRenderer(cellRenderer); + cellRenderer.setTransparentIconBackground(true); setOpaque(false); } @@ -66,6 +67,8 @@ public abstract class ProjectViewTree extends DnDAwareTree { @Override protected void paintComponent(Graphics g) { + g.setColor(getBackground()); + g.fillRect(0, 0, getWidth(), getHeight()); if (isFileColorsEnabled()) { paintFileColorGutter(g); } @@ -74,7 +77,7 @@ public abstract class ProjectViewTree extends DnDAwareTree { } @Override - protected boolean isFileColorsEnabled() { + public boolean isFileColorsEnabled() { return FileColorManagerImpl._isEnabled() && FileColorManagerImpl._isEnabledForProjectView(); } diff --git a/platform/platform-api/src/com/intellij/ui/ComponentWithFileColors.java b/platform/platform-api/src/com/intellij/ui/ComponentWithFileColors.java new file mode 100644 index 000000000000..1448e9ae92ed --- /dev/null +++ b/platform/platform-api/src/com/intellij/ui/ComponentWithFileColors.java @@ -0,0 +1,23 @@ +/* + * Copyright 2000-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.intellij.ui; + +/** + * @author Konstantin Bulenkov + */ +public interface ComponentWithFileColors { + boolean isFileColorsEnabled(); +} diff --git a/platform/platform-api/src/com/intellij/ui/SimpleColoredComponent.java b/platform/platform-api/src/com/intellij/ui/SimpleColoredComponent.java index d43d97a5cc58..7fb68fdfd301 100644 --- a/platform/platform-api/src/com/intellij/ui/SimpleColoredComponent.java +++ b/platform/platform-api/src/com/intellij/ui/SimpleColoredComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -636,6 +636,10 @@ public class SimpleColoredComponent extends JComponent implements Accessible { return myTransparentIconBackground; } + public void setTransparentIconBackground(boolean transparentIconBackground) { + myTransparentIconBackground = transparentIconBackground; + } + private static int getTextBaseLine(FontMetrics metrics, final int height) { return (height - metrics.getHeight()) / 2 + metrics.getAscent(); } diff --git a/platform/platform-api/src/com/intellij/ui/treeStructure/Tree.java b/platform/platform-api/src/com/intellij/ui/treeStructure/Tree.java index 9753066c297c..ce554a30b2fe 100644 --- a/platform/platform-api/src/com/intellij/ui/treeStructure/Tree.java +++ b/platform/platform-api/src/com/intellij/ui/treeStructure/Tree.java @@ -21,10 +21,7 @@ import com.intellij.openapi.ui.Queryable; import com.intellij.openapi.util.Disposer; import com.intellij.openapi.util.SystemInfo; import com.intellij.openapi.wm.impl.content.GraphicsConfig; -import com.intellij.ui.ComponentWithExpandableItems; -import com.intellij.ui.ExpandableItemsHandler; -import com.intellij.ui.ExpandableItemsHandlerFactory; -import com.intellij.ui.LoadingNode; +import com.intellij.ui.*; import com.intellij.util.ReflectionUtil; import com.intellij.util.ui.AsyncProcessIcon; import com.intellij.util.ui.ComponentWithEmptyText; @@ -48,7 +45,8 @@ import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Map; -public class Tree extends JTree implements ComponentWithEmptyText, ComponentWithExpandableItems, Autoscroll, Queryable { +public class Tree extends JTree implements ComponentWithEmptyText, ComponentWithExpandableItems, Autoscroll, Queryable, + ComponentWithFileColors { private StatusText myEmptyText; private ExpandableItemsHandler myExpandableItemsHandler; @@ -132,7 +130,7 @@ public class Tree extends JTree implements ComponentWithEmptyText, ComponentWith return true; } - protected boolean isFileColorsEnabled() { + public boolean isFileColorsEnabled() { return false; } diff --git a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/GridLayoutOperation.java b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/GridLayoutOperation.java index 45c2cf373dfd..1048cfa3ab1e 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/GridLayoutOperation.java +++ b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/GridLayoutOperation.java @@ -15,6 +15,7 @@ */ package com.intellij.android.designer.designSurface.layout; +import com.intellij.android.designer.designSurface.layout.grid.GridOperation; import com.intellij.designer.designSurface.OperationContext; import com.intellij.designer.model.RadComponent; diff --git a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/LinearLayoutOperation.java b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/LinearLayoutOperation.java index a789c5db3bf7..f943ed3dba1b 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/LinearLayoutOperation.java +++ b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/LinearLayoutOperation.java @@ -15,6 +15,8 @@ */ package com.intellij.android.designer.designSurface.layout; +import com.intellij.android.designer.designSurface.layout.actions.ResizeOperation; +import com.intellij.android.designer.designSurface.layout.flow.FlowBaseOperation; import com.intellij.android.designer.model.ModelParser; import com.intellij.android.designer.model.RadViewComponent; import com.intellij.android.designer.model.layout.Gravity; diff --git a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/TableLayoutOperation.java b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/TableLayoutOperation.java index 686bf2460137..f248b0273ff3 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/TableLayoutOperation.java +++ b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/TableLayoutOperation.java @@ -15,13 +15,14 @@ */ package com.intellij.android.designer.designSurface.layout; +import com.intellij.android.designer.designSurface.layout.grid.GridOperation; import com.intellij.android.designer.model.ModelParser; import com.intellij.android.designer.model.RadViewComponent; import com.intellij.android.designer.model.ViewsMetaManager; -import com.intellij.android.designer.model.agrid.GridInfo; -import com.intellij.android.designer.model.agrid.GridInsertType; -import com.intellij.android.designer.model.table.RadTableLayoutComponent; -import com.intellij.android.designer.model.table.RadTableRowLayout; +import com.intellij.android.designer.model.grid.GridInfo; +import com.intellij.android.designer.model.grid.GridInsertType; +import com.intellij.android.designer.model.layout.table.RadTableLayoutComponent; +import com.intellij.android.designer.model.layout.table.RadTableRowLayout; import com.intellij.designer.designSurface.OperationContext; import com.intellij.designer.model.MetaManager; import com.intellij.designer.model.MetaModel; diff --git a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/LayoutMarginOperation.java b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/actions/LayoutMarginOperation.java similarity index 99% rename from plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/LayoutMarginOperation.java rename to plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/actions/LayoutMarginOperation.java index 153ed19e140b..9153d87e2c51 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/LayoutMarginOperation.java +++ b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/actions/LayoutMarginOperation.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.intellij.android.designer.designSurface.layout; +package com.intellij.android.designer.designSurface.layout.actions; import com.intellij.android.designer.model.ModelParser; import com.intellij.android.designer.model.RadViewComponent; diff --git a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/LayoutSpanOperation.java b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/actions/LayoutSpanOperation.java similarity index 97% rename from plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/LayoutSpanOperation.java rename to plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/actions/LayoutSpanOperation.java index 1672f8528781..280a594b5e54 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/LayoutSpanOperation.java +++ b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/actions/LayoutSpanOperation.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.intellij.android.designer.designSurface.layout; +package com.intellij.android.designer.designSurface.layout.actions; import com.intellij.android.designer.model.ModelParser; import com.intellij.android.designer.model.RadViewComponent; -import com.intellij.android.designer.model.agrid.GridInfo; -import com.intellij.android.designer.model.table.RadTableLayoutComponent; +import com.intellij.android.designer.model.grid.GridInfo; +import com.intellij.android.designer.model.layout.table.RadTableLayoutComponent; import com.intellij.designer.designSurface.EditOperation; import com.intellij.designer.designSurface.FeedbackLayer; import com.intellij.designer.designSurface.OperationContext; diff --git a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/LayoutWeightOperation.java b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/actions/LayoutWeightOperation.java similarity index 98% rename from plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/LayoutWeightOperation.java rename to plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/actions/LayoutWeightOperation.java index 5f3bc35e69ac..bd583b0bc88c 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/LayoutWeightOperation.java +++ b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/actions/LayoutWeightOperation.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.intellij.android.designer.designSurface.layout; +package com.intellij.android.designer.designSurface.layout.actions; import com.intellij.android.designer.model.ModelParser; import com.intellij.designer.designSurface.OperationContext; diff --git a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/ResizeOperation.java b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/actions/ResizeOperation.java similarity index 99% rename from plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/ResizeOperation.java rename to plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/actions/ResizeOperation.java index a2efd0920c95..32605ebb346c 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/ResizeOperation.java +++ b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/actions/ResizeOperation.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.intellij.android.designer.designSurface.layout; +package com.intellij.android.designer.designSurface.layout.actions; import com.intellij.android.designer.model.RadViewComponent; import com.intellij.android.designer.propertyTable.renderers.ResourceRenderer; diff --git a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/HorizontalCaptionFlowBaseOperation.java b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/caption/HorizontalCaptionFlowBaseOperation.java similarity index 94% rename from plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/HorizontalCaptionFlowBaseOperation.java rename to plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/caption/HorizontalCaptionFlowBaseOperation.java index b12944f7bf59..fe25bcb7ccb9 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/HorizontalCaptionFlowBaseOperation.java +++ b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/caption/HorizontalCaptionFlowBaseOperation.java @@ -13,13 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.intellij.android.designer.designSurface.layout; +package com.intellij.android.designer.designSurface.layout.caption; import com.intellij.android.designer.model.ModelParser; import com.intellij.android.designer.model.RadViewComponent; -import com.intellij.android.designer.model.table.RadCaptionTableColumn; -import com.intellij.android.designer.model.table.RadTableLayoutComponent; -import com.intellij.android.designer.model.table.RadTableRowLayout; +import com.intellij.android.designer.model.layout.table.RadCaptionTableColumn; +import com.intellij.android.designer.model.layout.table.RadTableLayoutComponent; +import com.intellij.android.designer.model.layout.table.RadTableRowLayout; import com.intellij.designer.designSurface.EditableArea; import com.intellij.designer.designSurface.FeedbackLayer; import com.intellij.designer.designSurface.FlowBaseOperation; diff --git a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/VerticalCaptionFlowBaseOperation.java b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/caption/VerticalCaptionFlowBaseOperation.java similarity index 94% rename from plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/VerticalCaptionFlowBaseOperation.java rename to plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/caption/VerticalCaptionFlowBaseOperation.java index 006fd4e8bba5..c51d7fda924e 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/VerticalCaptionFlowBaseOperation.java +++ b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/caption/VerticalCaptionFlowBaseOperation.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.intellij.android.designer.designSurface.layout; +package com.intellij.android.designer.designSurface.layout.caption; import com.intellij.android.designer.designSurface.AbstractEditOperation; import com.intellij.android.designer.model.RadViewComponent; -import com.intellij.android.designer.model.table.RadCaptionTableRow; -import com.intellij.android.designer.model.table.RadTableLayoutComponent; +import com.intellij.android.designer.model.layout.table.RadCaptionTableRow; +import com.intellij.android.designer.model.layout.table.RadTableLayoutComponent; import com.intellij.designer.designSurface.EditableArea; import com.intellij.designer.designSurface.FlowBaseOperation; import com.intellij.designer.designSurface.OperationContext; diff --git a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/FlowBaseOperation.java b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/flow/FlowBaseOperation.java similarity index 96% rename from plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/FlowBaseOperation.java rename to plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/flow/FlowBaseOperation.java index bb4c2555f7a8..98e9a7b8776c 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/FlowBaseOperation.java +++ b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/flow/FlowBaseOperation.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.intellij.android.designer.designSurface.layout; +package com.intellij.android.designer.designSurface.layout.flow; import com.intellij.android.designer.designSurface.AbstractEditOperation; import com.intellij.android.designer.model.RadViewComponent; diff --git a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/FlowStaticDecorator.java b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/flow/FlowStaticDecorator.java similarity index 93% rename from plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/FlowStaticDecorator.java rename to plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/flow/FlowStaticDecorator.java index 61a50302748e..4839553c1ca4 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/FlowStaticDecorator.java +++ b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/flow/FlowStaticDecorator.java @@ -13,8 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.intellij.android.designer.designSurface.layout; +package com.intellij.android.designer.designSurface.layout.flow; +import com.intellij.android.designer.designSurface.layout.BorderStaticDecorator; import com.intellij.android.designer.model.RadViewComponent; import com.intellij.designer.designSurface.DecorationLayer; import com.intellij.designer.designSurface.StaticDecorator; diff --git a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/GridDecorator.java b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/grid/GridDecorator.java similarity index 83% rename from plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/GridDecorator.java rename to plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/grid/GridDecorator.java index a98727888bcf..0166c0c74f37 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/GridDecorator.java +++ b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/grid/GridDecorator.java @@ -13,10 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.intellij.android.designer.designSurface.layout; +package com.intellij.android.designer.designSurface.layout.grid; -import com.intellij.android.designer.model.agrid.GridInfo; -import com.intellij.android.designer.model.agrid.IGridProvider; +import com.intellij.android.designer.designSurface.layout.BorderStaticDecorator; +import com.intellij.android.designer.designSurface.layout.flow.FlowStaticDecorator; +import com.intellij.android.designer.model.grid.GridInfo; +import com.intellij.android.designer.model.grid.IGridProvider; import com.intellij.designer.designSurface.DecorationLayer; import com.intellij.designer.designSurface.StaticDecorator; import com.intellij.designer.model.RadComponent; diff --git a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/GridOperation.java b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/grid/GridOperation.java similarity index 97% rename from plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/GridOperation.java rename to plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/grid/GridOperation.java index ea799d5d2f80..4e519cbf4dca 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/GridOperation.java +++ b/plugins/android-designer/src/com/intellij/android/designer/designSurface/layout/grid/GridOperation.java @@ -13,12 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.intellij.android.designer.designSurface.layout; +package com.intellij.android.designer.designSurface.layout.grid; import com.intellij.android.designer.designSurface.AbstractEditOperation; -import com.intellij.android.designer.model.agrid.GridInfo; -import com.intellij.android.designer.model.agrid.GridInsertType; -import com.intellij.android.designer.model.agrid.IGridProvider; +import com.intellij.android.designer.designSurface.layout.BorderStaticDecorator; +import com.intellij.android.designer.model.grid.GridInfo; +import com.intellij.android.designer.model.grid.GridInsertType; +import com.intellij.android.designer.model.grid.IGridProvider; import com.intellij.designer.designSurface.FeedbackLayer; import com.intellij.designer.designSurface.OperationContext; import com.intellij.designer.designSurface.feedbacks.AlphaFeedback; diff --git a/plugins/android-designer/src/com/intellij/android/designer/model/agrid/GridInfo.java b/plugins/android-designer/src/com/intellij/android/designer/model/grid/GridInfo.java similarity index 97% rename from plugins/android-designer/src/com/intellij/android/designer/model/agrid/GridInfo.java rename to plugins/android-designer/src/com/intellij/android/designer/model/grid/GridInfo.java index 4ac7bbc9f6cd..5820c87e3405 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/model/agrid/GridInfo.java +++ b/plugins/android-designer/src/com/intellij/android/designer/model/grid/GridInfo.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.intellij.android.designer.model.agrid; +package com.intellij.android.designer.model.grid; import com.intellij.designer.model.RadComponent; import com.intellij.util.ArrayUtil; diff --git a/plugins/android-designer/src/com/intellij/android/designer/model/agrid/GridInsertType.java b/plugins/android-designer/src/com/intellij/android/designer/model/grid/GridInsertType.java similarity index 94% rename from plugins/android-designer/src/com/intellij/android/designer/model/agrid/GridInsertType.java rename to plugins/android-designer/src/com/intellij/android/designer/model/grid/GridInsertType.java index 85031d642f36..b1da02239180 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/model/agrid/GridInsertType.java +++ b/plugins/android-designer/src/com/intellij/android/designer/model/grid/GridInsertType.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.intellij.android.designer.model.agrid; +package com.intellij.android.designer.model.grid; /** * @author Alexander Lobas diff --git a/plugins/android-designer/src/com/intellij/android/designer/model/agrid/IGridProvider.java b/plugins/android-designer/src/com/intellij/android/designer/model/grid/IGridProvider.java similarity index 93% rename from plugins/android-designer/src/com/intellij/android/designer/model/agrid/IGridProvider.java rename to plugins/android-designer/src/com/intellij/android/designer/model/grid/IGridProvider.java index cf1b97c00cea..b345b55da96b 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/model/agrid/IGridProvider.java +++ b/plugins/android-designer/src/com/intellij/android/designer/model/grid/IGridProvider.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.intellij.android.designer.model.agrid; +package com.intellij.android.designer.model.grid; /** * @author Alexander Lobas diff --git a/plugins/android-designer/src/com/intellij/android/designer/model/agrid/RadCaptionColumn.java b/plugins/android-designer/src/com/intellij/android/designer/model/grid/RadCaptionColumn.java similarity index 96% rename from plugins/android-designer/src/com/intellij/android/designer/model/agrid/RadCaptionColumn.java rename to plugins/android-designer/src/com/intellij/android/designer/model/grid/RadCaptionColumn.java index 254037d30b46..3a9b085382eb 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/model/agrid/RadCaptionColumn.java +++ b/plugins/android-designer/src/com/intellij/android/designer/model/grid/RadCaptionColumn.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.intellij.android.designer.model.agrid; +package com.intellij.android.designer.model.grid; import com.intellij.android.designer.model.RadViewComponent; diff --git a/plugins/android-designer/src/com/intellij/android/designer/model/agrid/RadCaptionComponent.java b/plugins/android-designer/src/com/intellij/android/designer/model/grid/RadCaptionComponent.java similarity index 97% rename from plugins/android-designer/src/com/intellij/android/designer/model/agrid/RadCaptionComponent.java rename to plugins/android-designer/src/com/intellij/android/designer/model/grid/RadCaptionComponent.java index 5c3d87d801a6..237478c1327f 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/model/agrid/RadCaptionComponent.java +++ b/plugins/android-designer/src/com/intellij/android/designer/model/grid/RadCaptionComponent.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.intellij.android.designer.model.agrid; +package com.intellij.android.designer.model.grid; import com.intellij.android.designer.designSurface.layout.CaptionStaticDecorator; import com.intellij.android.designer.model.RadViewComponent; diff --git a/plugins/android-designer/src/com/intellij/android/designer/model/agrid/RadCaptionRow.java b/plugins/android-designer/src/com/intellij/android/designer/model/grid/RadCaptionRow.java similarity index 96% rename from plugins/android-designer/src/com/intellij/android/designer/model/agrid/RadCaptionRow.java rename to plugins/android-designer/src/com/intellij/android/designer/model/grid/RadCaptionRow.java index 04443bf3e2ee..ec46463d6dbf 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/model/agrid/RadCaptionRow.java +++ b/plugins/android-designer/src/com/intellij/android/designer/model/grid/RadCaptionRow.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.intellij.android.designer.model.agrid; +package com.intellij.android.designer.model.grid; import com.intellij.android.designer.model.RadViewComponent; diff --git a/plugins/android-designer/src/com/intellij/android/designer/model/layout/RadAbsoluteLayout.java b/plugins/android-designer/src/com/intellij/android/designer/model/layout/RadAbsoluteLayout.java index bea6245f5eac..5c710364f13c 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/model/layout/RadAbsoluteLayout.java +++ b/plugins/android-designer/src/com/intellij/android/designer/model/layout/RadAbsoluteLayout.java @@ -17,7 +17,7 @@ package com.intellij.android.designer.model.layout; import com.intellij.android.designer.designSurface.TreeDropToOperation; import com.intellij.android.designer.designSurface.layout.AbsoluteLayoutOperation; -import com.intellij.android.designer.designSurface.layout.ResizeOperation; +import com.intellij.android.designer.designSurface.layout.actions.ResizeOperation; import com.intellij.android.designer.model.RadViewLayoutWithData; import com.intellij.designer.componentTree.TreeEditOperation; import com.intellij.designer.designSurface.ComponentDecorator; diff --git a/plugins/android-designer/src/com/intellij/android/designer/model/layout/RadFrameLayout.java b/plugins/android-designer/src/com/intellij/android/designer/model/layout/RadFrameLayout.java index 6e87f7fda5fc..da511cf7b3e4 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/model/layout/RadFrameLayout.java +++ b/plugins/android-designer/src/com/intellij/android/designer/model/layout/RadFrameLayout.java @@ -17,8 +17,8 @@ package com.intellij.android.designer.model.layout; import com.intellij.android.designer.designSurface.TreeDropToOperation; import com.intellij.android.designer.designSurface.layout.FrameLayoutOperation; -import com.intellij.android.designer.designSurface.layout.LayoutMarginOperation; -import com.intellij.android.designer.designSurface.layout.ResizeOperation; +import com.intellij.android.designer.designSurface.layout.actions.LayoutMarginOperation; +import com.intellij.android.designer.designSurface.layout.actions.ResizeOperation; import com.intellij.android.designer.model.RadViewComponent; import com.intellij.android.designer.model.RadViewLayoutWithData; import com.intellij.designer.componentTree.TreeEditOperation; diff --git a/plugins/android-designer/src/com/intellij/android/designer/model/layout/RadLinearLayout.java b/plugins/android-designer/src/com/intellij/android/designer/model/layout/RadLinearLayout.java index a7187af65c15..97cbff9c4e52 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/model/layout/RadLinearLayout.java +++ b/plugins/android-designer/src/com/intellij/android/designer/model/layout/RadLinearLayout.java @@ -17,6 +17,10 @@ package com.intellij.android.designer.model.layout; import com.intellij.android.designer.designSurface.TreeDropToOperation; import com.intellij.android.designer.designSurface.layout.*; +import com.intellij.android.designer.designSurface.layout.actions.LayoutMarginOperation; +import com.intellij.android.designer.designSurface.layout.actions.LayoutWeightOperation; +import com.intellij.android.designer.designSurface.layout.actions.ResizeOperation; +import com.intellij.android.designer.designSurface.layout.flow.FlowStaticDecorator; import com.intellij.android.designer.model.RadViewComponent; import com.intellij.android.designer.model.RadViewLayoutWithData; import com.intellij.designer.componentTree.TreeEditOperation; diff --git a/plugins/android-designer/src/com/intellij/android/designer/model/grid/RadCaptionGridColumn.java b/plugins/android-designer/src/com/intellij/android/designer/model/layout/grid/RadCaptionGridColumn.java similarity index 87% rename from plugins/android-designer/src/com/intellij/android/designer/model/grid/RadCaptionGridColumn.java rename to plugins/android-designer/src/com/intellij/android/designer/model/layout/grid/RadCaptionGridColumn.java index b250e4124cf9..81a4a767414f 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/model/grid/RadCaptionGridColumn.java +++ b/plugins/android-designer/src/com/intellij/android/designer/model/layout/grid/RadCaptionGridColumn.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.intellij.android.designer.model.grid; +package com.intellij.android.designer.model.layout.grid; -import com.intellij.android.designer.model.agrid.RadCaptionColumn; +import com.intellij.android.designer.model.grid.RadCaptionColumn; /** * @author Alexander Lobas diff --git a/plugins/android-designer/src/com/intellij/android/designer/model/grid/RadCaptionGridRow.java b/plugins/android-designer/src/com/intellij/android/designer/model/layout/grid/RadCaptionGridRow.java similarity index 87% rename from plugins/android-designer/src/com/intellij/android/designer/model/grid/RadCaptionGridRow.java rename to plugins/android-designer/src/com/intellij/android/designer/model/layout/grid/RadCaptionGridRow.java index 0e6b45016e81..9653054a30cd 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/model/grid/RadCaptionGridRow.java +++ b/plugins/android-designer/src/com/intellij/android/designer/model/layout/grid/RadCaptionGridRow.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.intellij.android.designer.model.grid; +package com.intellij.android.designer.model.layout.grid; -import com.intellij.android.designer.model.agrid.RadCaptionRow; +import com.intellij.android.designer.model.grid.RadCaptionRow; /** * @author Alexander Lobas diff --git a/plugins/android-designer/src/com/intellij/android/designer/model/grid/RadGridLayout.java b/plugins/android-designer/src/com/intellij/android/designer/model/layout/grid/RadGridLayout.java similarity index 94% rename from plugins/android-designer/src/com/intellij/android/designer/model/grid/RadGridLayout.java rename to plugins/android-designer/src/com/intellij/android/designer/model/layout/grid/RadGridLayout.java index 8161cbec0546..ca9e1f8bd6c1 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/model/grid/RadGridLayout.java +++ b/plugins/android-designer/src/com/intellij/android/designer/model/layout/grid/RadGridLayout.java @@ -13,16 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.intellij.android.designer.model.grid; +package com.intellij.android.designer.model.layout.grid; import com.intellij.android.designer.designSurface.TreeDropToOperation; -import com.intellij.android.designer.designSurface.layout.GridDecorator; +import com.intellij.android.designer.designSurface.layout.grid.GridDecorator; import com.intellij.android.designer.designSurface.layout.GridLayoutOperation; -import com.intellij.android.designer.designSurface.layout.LayoutSpanOperation; -import com.intellij.android.designer.designSurface.layout.ResizeOperation; +import com.intellij.android.designer.designSurface.layout.actions.LayoutSpanOperation; +import com.intellij.android.designer.designSurface.layout.actions.ResizeOperation; import com.intellij.android.designer.model.RadViewLayout; import com.intellij.android.designer.model.RadViewLayoutWithData; -import com.intellij.android.designer.model.agrid.GridInfo; +import com.intellij.android.designer.model.grid.GridInfo; import com.intellij.designer.componentTree.TreeEditOperation; import com.intellij.designer.designSurface.*; import com.intellij.designer.designSurface.selection.ResizeSelectionDecorator; diff --git a/plugins/android-designer/src/com/intellij/android/designer/model/grid/RadGridLayoutComponent.java b/plugins/android-designer/src/com/intellij/android/designer/model/layout/grid/RadGridLayoutComponent.java similarity index 97% rename from plugins/android-designer/src/com/intellij/android/designer/model/grid/RadGridLayoutComponent.java rename to plugins/android-designer/src/com/intellij/android/designer/model/layout/grid/RadGridLayoutComponent.java index ecb598719528..4b722d4e0fec 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/model/grid/RadGridLayoutComponent.java +++ b/plugins/android-designer/src/com/intellij/android/designer/model/layout/grid/RadGridLayoutComponent.java @@ -13,13 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.intellij.android.designer.model.grid; +package com.intellij.android.designer.model.layout.grid; import com.android.ide.common.rendering.api.ViewInfo; import com.intellij.android.designer.model.RadViewComponent; import com.intellij.android.designer.model.RadViewContainer; -import com.intellij.android.designer.model.agrid.GridInfo; -import com.intellij.android.designer.model.agrid.IGridProvider; +import com.intellij.android.designer.model.grid.GridInfo; +import com.intellij.android.designer.model.grid.IGridProvider; import com.intellij.designer.model.RadComponent; import java.awt.*; diff --git a/plugins/android-designer/src/com/intellij/android/designer/model/table/RadCaptionTableColumn.java b/plugins/android-designer/src/com/intellij/android/designer/model/layout/table/RadCaptionTableColumn.java similarity index 89% rename from plugins/android-designer/src/com/intellij/android/designer/model/table/RadCaptionTableColumn.java rename to plugins/android-designer/src/com/intellij/android/designer/model/layout/table/RadCaptionTableColumn.java index 88e3bfffd99c..48bf5c11e4c0 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/model/table/RadCaptionTableColumn.java +++ b/plugins/android-designer/src/com/intellij/android/designer/model/layout/table/RadCaptionTableColumn.java @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.intellij.android.designer.model.table; +package com.intellij.android.designer.model.layout.table; -import com.intellij.android.designer.model.agrid.GridInfo; -import com.intellij.android.designer.model.agrid.RadCaptionColumn; +import com.intellij.android.designer.model.grid.GridInfo; +import com.intellij.android.designer.model.grid.RadCaptionColumn; import com.intellij.designer.model.RadComponent; /** diff --git a/plugins/android-designer/src/com/intellij/android/designer/model/table/RadCaptionTableRow.java b/plugins/android-designer/src/com/intellij/android/designer/model/layout/table/RadCaptionTableRow.java similarity index 97% rename from plugins/android-designer/src/com/intellij/android/designer/model/table/RadCaptionTableRow.java rename to plugins/android-designer/src/com/intellij/android/designer/model/layout/table/RadCaptionTableRow.java index d4b7c8012953..62a4ce6bc757 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/model/table/RadCaptionTableRow.java +++ b/plugins/android-designer/src/com/intellij/android/designer/model/layout/table/RadCaptionTableRow.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.intellij.android.designer.model.table; +package com.intellij.android.designer.model.layout.table; import com.intellij.android.designer.designSurface.layout.CaptionStaticDecorator; import com.intellij.android.designer.model.RadViewComponent; diff --git a/plugins/android-designer/src/com/intellij/android/designer/model/table/RadTableLayout.java b/plugins/android-designer/src/com/intellij/android/designer/model/layout/table/RadTableLayout.java similarity index 93% rename from plugins/android-designer/src/com/intellij/android/designer/model/table/RadTableLayout.java rename to plugins/android-designer/src/com/intellij/android/designer/model/layout/table/RadTableLayout.java index 99ff2662c568..2537cf108c79 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/model/table/RadTableLayout.java +++ b/plugins/android-designer/src/com/intellij/android/designer/model/layout/table/RadTableLayout.java @@ -13,14 +13,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.intellij.android.designer.model.table; +package com.intellij.android.designer.model.layout.table; import com.intellij.android.designer.designSurface.TreeDropToOperation; import com.intellij.android.designer.designSurface.layout.*; +import com.intellij.android.designer.designSurface.layout.actions.ResizeOperation; +import com.intellij.android.designer.designSurface.layout.caption.HorizontalCaptionFlowBaseOperation; +import com.intellij.android.designer.designSurface.layout.caption.VerticalCaptionFlowBaseOperation; +import com.intellij.android.designer.designSurface.layout.grid.GridDecorator; import com.intellij.android.designer.model.RadViewComponent; import com.intellij.android.designer.model.RadViewLayout; import com.intellij.android.designer.model.RadViewLayoutWithData; -import com.intellij.android.designer.model.agrid.GridInfo; +import com.intellij.android.designer.model.grid.GridInfo; import com.intellij.designer.componentTree.TreeEditOperation; import com.intellij.designer.designSurface.*; import com.intellij.designer.designSurface.selection.ResizeSelectionDecorator; diff --git a/plugins/android-designer/src/com/intellij/android/designer/model/table/RadTableLayoutComponent.java b/plugins/android-designer/src/com/intellij/android/designer/model/layout/table/RadTableLayoutComponent.java similarity index 97% rename from plugins/android-designer/src/com/intellij/android/designer/model/table/RadTableLayoutComponent.java rename to plugins/android-designer/src/com/intellij/android/designer/model/layout/table/RadTableLayoutComponent.java index 96686eb9a271..a2e15ceac8c3 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/model/table/RadTableLayoutComponent.java +++ b/plugins/android-designer/src/com/intellij/android/designer/model/layout/table/RadTableLayoutComponent.java @@ -13,14 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.intellij.android.designer.model.table; +package com.intellij.android.designer.model.layout.table; import com.android.ide.common.rendering.api.ViewInfo; import com.intellij.android.designer.model.ModelParser; import com.intellij.android.designer.model.RadViewComponent; import com.intellij.android.designer.model.RadViewContainer; -import com.intellij.android.designer.model.agrid.GridInfo; -import com.intellij.android.designer.model.agrid.IGridProvider; +import com.intellij.android.designer.model.grid.GridInfo; +import com.intellij.android.designer.model.grid.IGridProvider; import com.intellij.designer.model.RadComponent; import com.intellij.openapi.application.ApplicationManager; import com.intellij.psi.xml.XmlTag; diff --git a/plugins/android-designer/src/com/intellij/android/designer/model/table/RadTableRowLayout.java b/plugins/android-designer/src/com/intellij/android/designer/model/layout/table/RadTableRowLayout.java similarity index 98% rename from plugins/android-designer/src/com/intellij/android/designer/model/table/RadTableRowLayout.java rename to plugins/android-designer/src/com/intellij/android/designer/model/layout/table/RadTableRowLayout.java index 8e3ebb0b6c4e..32d06a199ba9 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/model/table/RadTableRowLayout.java +++ b/plugins/android-designer/src/com/intellij/android/designer/model/layout/table/RadTableRowLayout.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.intellij.android.designer.model.table; +package com.intellij.android.designer.model.layout.table; -import com.intellij.android.designer.designSurface.layout.LayoutSpanOperation; +import com.intellij.android.designer.designSurface.layout.actions.LayoutSpanOperation; import com.intellij.android.designer.model.ModelParser; import com.intellij.android.designer.model.RadViewComponent; import com.intellij.android.designer.model.layout.AbstractGravityAction; diff --git a/plugins/android-designer/src/com/intellij/android/designer/model/views-meta-model.xml b/plugins/android-designer/src/com/intellij/android/designer/model/views-meta-model.xml index cd85637140ed..ab501ad6539b 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/model/views-meta-model.xml +++ b/plugins/android-designer/src/com/intellij/android/designer/model/views-meta-model.xml @@ -1099,8 +1099,8 @@ - @@ -1120,7 +1120,7 @@ @@ -1137,8 +1137,8 @@ - diff --git a/plugins/junit/src/com/intellij/execution/junit2/configuration/JUnitConfigurable.form b/plugins/junit/src/com/intellij/execution/junit2/configuration/JUnitConfigurable.form index baee54995966..35fe1ca6bd82 100644 --- a/plugins/junit/src/com/intellij/execution/junit2/configuration/JUnitConfigurable.form +++ b/plugins/junit/src/com/intellij/execution/junit2/configuration/JUnitConfigurable.form @@ -10,7 +10,7 @@ - + @@ -91,7 +91,7 @@ - + diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenExternalParameters.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenExternalParameters.java index 1000db73d50f..e6e0d2a7018c 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenExternalParameters.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenExternalParameters.java @@ -31,6 +31,8 @@ import com.intellij.openapi.projectRoots.JavaSdk; import com.intellij.openapi.projectRoots.ProjectJdkTable; import com.intellij.openapi.projectRoots.Sdk; import com.intellij.openapi.projectRoots.impl.JavaAwareProjectJdkTableImpl; +import com.intellij.openapi.roots.ProjectRootManager; +import com.intellij.openapi.roots.ui.configuration.ProjectSettingsService; import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vfs.encoding.EncodingManager; import com.intellij.openapi.vfs.encoding.EncodingProjectManager; @@ -99,7 +101,7 @@ public class MavenExternalParameters { params.setWorkingDirectory(parameters.getWorkingDirFile()); - params.setJdk(getJdk(runnerSettings, project != null && MavenRunner.getInstance(project).getState() == runnerSettings)); + params.setJdk(getJdk(project, runnerSettings, project != null && MavenRunner.getInstance(project).getState() == runnerSettings)); final String mavenHome = resolveMavenHome(coreSettings, project, runConfiguration); @@ -121,12 +123,29 @@ public class MavenExternalParameters { } @NotNull - private static Sdk getJdk(MavenRunnerSettings runnerSettings, boolean isGlobalRunnerSettings) throws ExecutionException { + private static Sdk getJdk(@Nullable Project project, MavenRunnerSettings runnerSettings, boolean isGlobalRunnerSettings) throws ExecutionException { String name = runnerSettings.getJreName(); if (name.equals(MavenRunnerSettings.USE_INTERNAL_JAVA)) { return JavaAwareProjectJdkTableImpl.getInstanceEx().getInternalJdk(); } + if (name.equals(MavenRunnerSettings.USE_PROJECT_JDK)) { + if (project != null) { + Sdk res = ProjectRootManager.getInstance(project).getProjectSdk(); + if (res != null) { + return res; + } + } + + if (project == null) { + Sdk recent = ProjectJdkTable.getInstance().findMostRecentSdkOfType(JavaSdk.getInstance()); + if (recent != null) return recent; + return JavaAwareProjectJdkTableImpl.getInstanceEx().getInternalJdk(); + } + + throw new ProjectJdkSettingsOpenerExecutionException("Project JDK is not specified. Configure", project); + } + if (name.equals(MavenRunnerSettings.USE_JAVA_HOME)) { final String javaHome = System.getenv(JAVA_HOME); if (StringUtil.isEmptyOrSpaces(javaHome)) { @@ -355,6 +374,23 @@ public class MavenExternalParameters { } } + private static class ProjectJdkSettingsOpenerExecutionException extends ExecutionException implements HyperlinkListener { + + private final Project myProject; + + public ProjectJdkSettingsOpenerExecutionException(final String s, Project project) { + super(s); + myProject = project; + } + + @Override + public void hyperlinkUpdate(HyperlinkEvent e) { + if (e.getEventType() != HyperlinkEvent.EventType.ACTIVATED) return; + + ProjectSettingsService.getInstance(myProject).openProjectSettings(); + } + } + private static class RunConfigurationOpenerExecutionException extends ExecutionException implements HyperlinkListener { private final MavenRunConfiguration myRunConfiguration; diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenRunnerConfigurable.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenRunnerConfigurable.java index aab2a8204a50..ec90fbee1d6d 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenRunnerConfigurable.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenRunnerConfigurable.java @@ -21,6 +21,10 @@ import com.intellij.openapi.options.Configurable; import com.intellij.openapi.options.ConfigurationException; import com.intellij.openapi.options.SearchableConfigurable; import com.intellij.openapi.project.Project; +import com.intellij.openapi.projectRoots.JavaSdk; +import com.intellij.openapi.projectRoots.ProjectJdkTable; +import com.intellij.openapi.projectRoots.Sdk; +import com.intellij.openapi.roots.ProjectRootManager; import com.intellij.ui.IdeBorderFactory; import com.intellij.ui.RawCommandLineEditor; import org.jetbrains.annotations.Nls; @@ -50,7 +54,7 @@ public abstract class MavenRunnerConfigurable implements SearchableConfigurable, private Map myProperties; - public MavenRunnerConfigurable(Project p, boolean isRunConfiguration) { + public MavenRunnerConfigurable(@NotNull Project p, boolean isRunConfiguration) { myProject = p; myRunConfigurationMode = isRunConfiguration; } @@ -189,7 +193,7 @@ public abstract class MavenRunnerConfigurable implements SearchableConfigurable, myVMParametersEditor.setText(data.getVmOptions()); mySkipTestsCheckBox.setSelected(data.isSkipTests()); - Map jdkMap = data.collectJdkNamesAndDescriptions(); + Map jdkMap = collectJdkNamesAndDescriptions(); if (!jdkMap.containsKey(data.getJreName())) { jdkMap.put(data.getJreName(), data.getJreName()); } @@ -204,6 +208,32 @@ public abstract class MavenRunnerConfigurable implements SearchableConfigurable, myPropertiesPanel.setDataFromMap(data.getMavenProperties()); } + private Map collectJdkNamesAndDescriptions() { + Map result = new LinkedHashMap(); + + for (Sdk projectJdk : ProjectJdkTable.getInstance().getSdksOfType(JavaSdk.getInstance())) { + String name = projectJdk.getName(); + result.put(name, name); + } + + result.put(MavenRunnerSettings.USE_INTERNAL_JAVA, RunnerBundle.message("maven.java.internal")); + + String projectJdkTitle; + + String projectJdk = ProjectRootManager.getInstance(myProject).getProjectSdkName(); + if (projectJdk == null) { + projectJdkTitle = "Use Project JDK (not defined yet)"; + } + else { + projectJdkTitle = "Use Project JDK (" + projectJdk + ')'; + } + + result.put(MavenRunnerSettings.USE_PROJECT_JDK, projectJdkTitle); + result.put(MavenRunnerSettings.USE_JAVA_HOME, RunnerBundle.message("maven.java.home.env")); + + return result; + } + void setData(MavenRunnerSettings data) { data.setRunMavenInBackground(myRunInBackgroundCheckbox.isSelected()); data.setVmOptions(myVMParametersEditor.getText().trim()); diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenRunnerSettings.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenRunnerSettings.java index 4cf38fec00e4..5df81b8e61fd 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenRunnerSettings.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenRunnerSettings.java @@ -21,15 +21,12 @@ package org.jetbrains.idea.maven.execution; import com.intellij.openapi.projectRoots.JavaSdk; import com.intellij.openapi.projectRoots.ProjectJdkTable; import com.intellij.openapi.projectRoots.Sdk; -import com.intellij.openapi.projectRoots.SdkType; -import com.intellij.openapi.util.Pair; import com.intellij.openapi.util.text.StringUtil; import com.intellij.util.containers.ContainerUtil; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -37,10 +34,11 @@ import java.util.Map; public class MavenRunnerSettings implements Cloneable { @NonNls public static final String USE_INTERNAL_JAVA = "#JAVA_INTERNAL"; + @NonNls public static final String USE_PROJECT_JDK = "#USE_PROJECT_JDK"; @NonNls public static final String USE_JAVA_HOME = "#JAVA_HOME"; private boolean runMavenInBackground = true; - @NotNull private String jreName = ""; + @NotNull private String jreName = USE_PROJECT_JDK; @NotNull private String vmOptions = ""; private boolean skipTests = false; private Map mavenProperties = new LinkedHashMap(); @@ -57,9 +55,6 @@ public class MavenRunnerSettings implements Cloneable { @NotNull public String getJreName() { - if (StringUtil.isEmpty(jreName)) { - jreName = getDefaultJdkName(); - } return jreName; } @@ -98,30 +93,6 @@ public class MavenRunnerSettings implements Cloneable { this.mavenProperties = mavenProperties; } - public Map collectJdkNamesAndDescriptions() { - Map result = new LinkedHashMap(); - - for (Sdk projectJdk : ProjectJdkTable.getInstance().getSdksOfType(getSdkType())) { - String name = projectJdk.getName(); - result.put(name, name); - } - - result.put(USE_INTERNAL_JAVA, RunnerBundle.message("maven.java.internal")); - result.put(USE_JAVA_HOME, RunnerBundle.message("maven.java.home.env")); - - return result; - } - - private SdkType getSdkType() { - return JavaSdk.getInstance(); - } - - public String getDefaultJdkName() { - Sdk recent = ProjectJdkTable.getInstance().findMostRecentSdkOfType(getSdkType()); - if (recent == null) return USE_INTERNAL_JAVA; - return recent.getName(); - } - public void addListener(Listener l) { myListeners.add(l); } diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenEnvironmentForm.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenEnvironmentForm.java index 2755eb81d341..a27ff1f62d8f 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenEnvironmentForm.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenEnvironmentForm.java @@ -27,6 +27,7 @@ import com.intellij.ui.PanelWithAnchor; import com.intellij.ui.components.JBLabel; import com.intellij.util.Alarm; import com.intellij.util.ui.UIUtil; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.idea.maven.utils.MavenUtil; @@ -127,6 +128,11 @@ public class MavenEnvironmentForm implements PanelWithAnchor { localRepositoryOverrider.reset(data.getLocalRepository()); } + @NotNull + public String getMavenHome() { + return mavenHomeOverrider.getResult(); + } + public JComponent createComponent() { // all listeners will be removed when dialog is closed mavenHomeComponent.getComponent().addBrowseFolderListener(ProjectBundle.message("maven.select.maven.home.directory"), "", null, diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/wizards/MavenModuleBuilder.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/wizards/MavenModuleBuilder.java index 1fcd564002be..1c1a584be9ef 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/wizards/MavenModuleBuilder.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/wizards/MavenModuleBuilder.java @@ -15,15 +15,14 @@ */ package org.jetbrains.idea.maven.wizards; -import com.intellij.ide.util.projectWizard.ModuleBuilder; -import com.intellij.ide.util.projectWizard.ModuleWizardStep; -import com.intellij.ide.util.projectWizard.SourcePathsBuilder; -import com.intellij.ide.util.projectWizard.WizardContext; +import com.intellij.ide.util.projectWizard.*; import com.intellij.openapi.module.ModuleType; import com.intellij.openapi.module.StdModuleTypes; import com.intellij.openapi.options.ConfigurationException; import com.intellij.openapi.project.DumbAwareRunnable; import com.intellij.openapi.project.Project; +import com.intellij.openapi.projectRoots.JavaSdk; +import com.intellij.openapi.projectRoots.Sdk; import com.intellij.openapi.roots.ModifiableRootModel; import com.intellij.openapi.roots.ui.configuration.ModulesProvider; import com.intellij.openapi.util.IconLoader; @@ -104,10 +103,18 @@ public class MavenModuleBuilder extends ModuleBuilder implements SourcePathsBuil return StdModuleTypes.JAVA; } + @Override + public boolean isSuitableSdk(Sdk sdk) { + return sdk.getSdkType() == JavaSdk.getInstance(); + } + @Override public ModuleWizardStep[] createWizardSteps(WizardContext wizardContext, ModulesProvider modulesProvider) { - return new ModuleWizardStep[]{new MavenModuleWizardStep(wizardContext.getProject(), this), - new SelectPropertiesStep(wizardContext.getProject(), this)}; + return new ModuleWizardStep[]{ + new MavenModuleWizardStep(wizardContext.getProject(), this), + new SelectPropertiesStep(wizardContext.getProject(), this), + ProjectWizardStepFactory.getInstance().createProjectJdkStep(wizardContext) + }; } public MavenProject findPotentialParentProject(Project project) { diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/wizards/SelectPropertiesStep.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/wizards/SelectPropertiesStep.java index 7f18f9426189..1996880c8fe2 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/wizards/SelectPropertiesStep.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/wizards/SelectPropertiesStep.java @@ -16,21 +16,21 @@ package org.jetbrains.idea.maven.wizards; import com.intellij.ide.util.projectWizard.ModuleWizardStep; +import com.intellij.openapi.options.ConfigurationException; import com.intellij.openapi.project.Project; import com.intellij.openapi.project.ProjectManager; import com.intellij.util.containers.hash.HashMap; import org.jetbrains.annotations.Nullable; import org.jetbrains.idea.maven.execution.MavenPropertiesPanel; -import org.jetbrains.idea.maven.indices.MavenIndex; import org.jetbrains.idea.maven.model.MavenArchetype; import org.jetbrains.idea.maven.model.MavenId; import org.jetbrains.idea.maven.project.MavenEnvironmentForm; -import org.jetbrains.idea.maven.project.MavenGeneralSettings; import org.jetbrains.idea.maven.project.MavenProjectsManager; +import org.jetbrains.idea.maven.utils.MavenUtil; import javax.swing.*; import java.awt.*; -import java.util.Collections; +import java.io.File; import java.util.LinkedHashMap; import java.util.Map; @@ -100,6 +100,20 @@ public class SelectPropertiesStep extends ModuleWizardStep { return myBuilder.getArchetype() != null; } + @Override + public boolean validate() throws ConfigurationException { + File mavenHome = MavenUtil.resolveMavenHomeDirectory(myEnvironmentForm.getMavenHome()); + if (mavenHome == null) { + throw new ConfigurationException("Maven home directory is not specified"); + } + + if (!MavenUtil.isValidMavenHome(mavenHome)) { + throw new ConfigurationException("Maven home directory is invalid: " + mavenHome); + } + + return true; + } + @Override public void updateDataModel() { myBuilder.setEnvironmentForm(myEnvironmentForm); diff --git a/plugins/svn4idea/lib/svnkit-javahl.jar b/plugins/svn4idea/lib/svnkit-javahl.jar index d0340baa4589..61ea823a37bc 100644 Binary files a/plugins/svn4idea/lib/svnkit-javahl.jar and b/plugins/svn4idea/lib/svnkit-javahl.jar differ diff --git a/plugins/svn4idea/lib/svnkit-javahl16.zip b/plugins/svn4idea/lib/svnkit-javahl16.zip index 9f6d0606fcbf..9d3cf3f62a7b 100644 Binary files a/plugins/svn4idea/lib/svnkit-javahl16.zip and b/plugins/svn4idea/lib/svnkit-javahl16.zip differ diff --git a/plugins/svn4idea/lib/svnkit.jar b/plugins/svn4idea/lib/svnkit.jar index 99bcf2ddf7d3..f0e64c09dc8d 100644 Binary files a/plugins/svn4idea/lib/svnkit.jar and b/plugins/svn4idea/lib/svnkit.jar differ diff --git a/plugins/svn4idea/lib/svnkitsrc.zip b/plugins/svn4idea/lib/svnkitsrc.zip index 6fceb2861be8..561393034ec4 100644 Binary files a/plugins/svn4idea/lib/svnkitsrc.zip and b/plugins/svn4idea/lib/svnkitsrc.zip differ