http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/tools/envisage/src/main/java/org/apache/zest/envisage/detail/DependencyPane.java ---------------------------------------------------------------------- diff --git a/tools/envisage/src/main/java/org/apache/zest/envisage/detail/DependencyPane.java b/tools/envisage/src/main/java/org/apache/zest/envisage/detail/DependencyPane.java index 3f08e79..78a2753 100644 --- a/tools/envisage/src/main/java/org/apache/zest/envisage/detail/DependencyPane.java +++ b/tools/envisage/src/main/java/org/apache/zest/envisage/detail/DependencyPane.java @@ -280,7 +280,7 @@ import org.apache.zest.tools.model.descriptor.ObjectDetailDescriptor; splitPane.setRightComponent( detailPane ); detailPane.setBorder( BorderFactory.createTitledBorder( BorderFactory.createEmptyBorder( 8, 8, 8, 8 ), null ) ); final JLabel label1 = new JLabel(); - this.$$$loadLabelText$$$( label1, ResourceBundle.getBundle( "org/qi4j/envisage/detail/DependencyPane" ).getString( "CTL_ClassName.Text" ) ); + this.$$$loadLabelText$$$( label1, ResourceBundle.getBundle( "org/apache/zest/envisage/detail/DependencyPane" ).getString( "CTL_ClassName.Text" ) ); GridBagConstraints gbc; gbc = new GridBagConstraints(); gbc.gridx = 0; @@ -300,14 +300,14 @@ import org.apache.zest.tools.model.descriptor.ObjectDetailDescriptor; gbc.fill = GridBagConstraints.VERTICAL; detailPane.add( spacer2, gbc ); final JLabel label2 = new JLabel(); - this.$$$loadLabelText$$$( label2, ResourceBundle.getBundle( "org/qi4j/envisage/detail/DependencyPane" ).getString( "CTL_Optional.Text" ) ); + this.$$$loadLabelText$$$( label2, ResourceBundle.getBundle( "org/apache/zest/envisage/detail/DependencyPane" ).getString( "CTL_Optional.Text" ) ); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 2; gbc.anchor = GridBagConstraints.EAST; detailPane.add( label2, gbc ); final JLabel label3 = new JLabel(); - this.$$$loadLabelText$$$( label3, ResourceBundle.getBundle( "org/qi4j/envisage/detail/DependencyPane" ).getString( "CTL_Annotation.Text" ) ); + this.$$$loadLabelText$$$( label3, ResourceBundle.getBundle( "org/apache/zest/envisage/detail/DependencyPane" ).getString( "CTL_Annotation.Text" ) ); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 4; @@ -332,7 +332,7 @@ import org.apache.zest.tools.model.descriptor.ObjectDetailDescriptor; gbc.fill = GridBagConstraints.VERTICAL; detailPane.add( spacer5, gbc ); final JLabel label4 = new JLabel(); - this.$$$loadLabelText$$$( label4, ResourceBundle.getBundle( "org/qi4j/envisage/detail/DependencyPane" ).getString( "CTL_InjectionType.Text" ) ); + this.$$$loadLabelText$$$( label4, ResourceBundle.getBundle( "org/apache/zest/envisage/detail/DependencyPane" ).getString( "CTL_InjectionType.Text" ) ); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 10; @@ -374,7 +374,7 @@ import org.apache.zest.tools.model.descriptor.ObjectDetailDescriptor; gbc.fill = GridBagConstraints.VERTICAL; detailPane.add( spacer6, gbc ); final JLabel label5 = new JLabel(); - this.$$$loadLabelText$$$( label5, ResourceBundle.getBundle( "org/qi4j/envisage/detail/DependencyPane" ).getString( "CTL_Injection.Text" ) ); + this.$$$loadLabelText$$$( label5, ResourceBundle.getBundle( "org/apache/zest/envisage/detail/DependencyPane" ).getString( "CTL_Injection.Text" ) ); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 8; @@ -396,7 +396,7 @@ import org.apache.zest.tools.model.descriptor.ObjectDetailDescriptor; gbc.fill = GridBagConstraints.VERTICAL; detailPane.add( spacer7, gbc ); final JLabel label6 = new JLabel(); - this.$$$loadLabelText$$$( label6, ResourceBundle.getBundle( "org/qi4j/envisage/detail/DependencyPane" ).getString( "CTL_InjectedServices.Text" ) ); + this.$$$loadLabelText$$$( label6, ResourceBundle.getBundle( "org/apache/zest/envisage/detail/DependencyPane" ).getString( "CTL_InjectedServices.Text" ) ); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 12;
http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/tools/envisage/src/main/java/org/apache/zest/envisage/detail/ImportedByPane.form ---------------------------------------------------------------------- diff --git a/tools/envisage/src/main/java/org/apache/zest/envisage/detail/ImportedByPane.form b/tools/envisage/src/main/java/org/apache/zest/envisage/detail/ImportedByPane.form index 14cd9fd..156683b 100644 --- a/tools/envisage/src/main/java/org/apache/zest/envisage/detail/ImportedByPane.form +++ b/tools/envisage/src/main/java/org/apache/zest/envisage/detail/ImportedByPane.form @@ -1,20 +1,4 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You 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. ---> <form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="org.apache.zest.envisage.detail.ImportedByPane"> <grid id="27dc6" binding="contentPane" layout-manager="GridBagLayout"> <constraints> @@ -29,7 +13,7 @@ <gridbag weightx="0.0" weighty="0.0"/> </constraints> <properties> - <text resource-bundle="org/qi4j/envisage/detail/ImportedByPane" key="CTL_Name.Text"/> + <text resource-bundle="org/apache/zest/envisage/detail/ImportedByPane" key="CTL_Name.Text"/> </properties> </component> <hspacer id="3491d"> @@ -59,7 +43,7 @@ <gridbag weightx="0.0" weighty="0.0"/> </constraints> <properties> - <text resource-bundle="org/qi4j/envisage/detail/ImportedByPane" key="CTL_Class.Text"/> + <text resource-bundle="org/apache/zest/envisage/detail/ImportedByPane" key="CTL_Class.Text"/> </properties> </component> <component id="17892" class="javax.swing.JLabel" binding="classLabel"> http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/tools/envisage/src/main/java/org/apache/zest/envisage/detail/ImportedByPane.java ---------------------------------------------------------------------- diff --git a/tools/envisage/src/main/java/org/apache/zest/envisage/detail/ImportedByPane.java b/tools/envisage/src/main/java/org/apache/zest/envisage/detail/ImportedByPane.java index 4f9f0f4..740c77e 100644 --- a/tools/envisage/src/main/java/org/apache/zest/envisage/detail/ImportedByPane.java +++ b/tools/envisage/src/main/java/org/apache/zest/envisage/detail/ImportedByPane.java @@ -88,7 +88,7 @@ import org.apache.zest.tools.model.descriptor.ImportedServiceDetailDescriptor; contentPane = new JPanel(); contentPane.setLayout( new GridBagLayout() ); final JLabel label1 = new JLabel(); - this.$$$loadLabelText$$$( label1, ResourceBundle.getBundle( "org/qi4j/envisage/detail/ImportedByPane" ).getString( "CTL_Name.Text" ) ); + this.$$$loadLabelText$$$( label1, ResourceBundle.getBundle( "org/apache/zest/envisage/detail/ImportedByPane" ).getString( "CTL_Name.Text" ) ); GridBagConstraints gbc; gbc = new GridBagConstraints(); gbc.gridx = 0; @@ -115,7 +115,7 @@ import org.apache.zest.tools.model.descriptor.ImportedServiceDetailDescriptor; gbc.anchor = GridBagConstraints.WEST; contentPane.add( nameLabel, gbc ); final JLabel label2 = new JLabel(); - this.$$$loadLabelText$$$( label2, ResourceBundle.getBundle( "org/qi4j/envisage/detail/ImportedByPane" ).getString( "CTL_Class.Text" ) ); + this.$$$loadLabelText$$$( label2, ResourceBundle.getBundle( "org/apache/zest/envisage/detail/ImportedByPane" ).getString( "CTL_Class.Text" ) ); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 3; http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/tools/envisage/src/main/java/org/apache/zest/envisage/detail/ServiceConfigurationPane.form ---------------------------------------------------------------------- diff --git a/tools/envisage/src/main/java/org/apache/zest/envisage/detail/ServiceConfigurationPane.form b/tools/envisage/src/main/java/org/apache/zest/envisage/detail/ServiceConfigurationPane.form index df1657b..61a90ea 100644 --- a/tools/envisage/src/main/java/org/apache/zest/envisage/detail/ServiceConfigurationPane.form +++ b/tools/envisage/src/main/java/org/apache/zest/envisage/detail/ServiceConfigurationPane.form @@ -1,24 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You 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. ---> <form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="org.apache.zest.envisage.detail.ServiceConfigurationPane"> <grid id="27dc6" binding="contentPane" layout-manager="GridBagLayout"> <constraints> - <xy x="20" y="20" width="311" height="266"/> + <xy x="20" y="20" width="1045" height="266"/> </constraints> <properties/> <border type="none"/> @@ -29,7 +13,7 @@ <gridbag weightx="0.0" weighty="0.0"/> </constraints> <properties> - <text resource-bundle="org/qi4j/envisage/detail/ServiceConfigurationPane" key="CTL_Name.Text"/> + <text resource-bundle="org/apache/zest/envisage/detail/ServiceConfigurationPane" key="CTL_Name.Text"/> </properties> </component> <hspacer id="f7748"> @@ -65,7 +49,7 @@ <gridbag weightx="0.0" weighty="0.0"/> </constraints> <properties> - <text resource-bundle="org/qi4j/envisage/detail/ServiceConfigurationPane" key="CTL_Class.Text"/> + <text resource-bundle="org/apache/zest/envisage/detail/ServiceConfigurationPane" key="CTL_Class.Text"/> </properties> </component> <component id="86ec7" class="javax.swing.JLabel" binding="classLabel"> @@ -89,7 +73,7 @@ <gridbag weightx="0.0" weighty="0.0"/> </constraints> <properties> - <text resource-bundle="org/qi4j/envisage/detail/ServiceConfigurationPane" key="CTL_Link.Text"/> + <text resource-bundle="org/apache/zest/envisage/detail/ServiceConfigurationPane" key="CTL_Link.Text"/> </properties> </component> <vspacer id="ab189"> @@ -104,7 +88,7 @@ <gridbag weightx="0.0" weighty="0.0"/> </constraints> <properties> - <text resource-bundle="org/qi4j/envisage/detail/ServiceConfigurationPane" key="CTL_Type.Text"/> + <text resource-bundle="org/apache/zest/envisage/detail/ServiceConfigurationPane" key="CTL_Type.Text"/> </properties> </component> <component id="845aa" class="javax.swing.JLabel" binding="typeLabel"> http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/tools/envisage/src/main/java/org/apache/zest/envisage/detail/ServiceConfigurationPane.java ---------------------------------------------------------------------- diff --git a/tools/envisage/src/main/java/org/apache/zest/envisage/detail/ServiceConfigurationPane.java b/tools/envisage/src/main/java/org/apache/zest/envisage/detail/ServiceConfigurationPane.java index 4eea22c..5b15bdb 100644 --- a/tools/envisage/src/main/java/org/apache/zest/envisage/detail/ServiceConfigurationPane.java +++ b/tools/envisage/src/main/java/org/apache/zest/envisage/detail/ServiceConfigurationPane.java @@ -190,7 +190,7 @@ import static org.apache.zest.functional.Iterables.first; contentPane = new JPanel(); contentPane.setLayout( new GridBagLayout() ); final JLabel label1 = new JLabel(); - this.$$$loadLabelText$$$( label1, ResourceBundle.getBundle( "org/qi4j/envisage/detail/ServiceConfigurationPane" ).getString( "CTL_Name.Text" ) ); + this.$$$loadLabelText$$$( label1, ResourceBundle.getBundle( "org/apache/zest/envisage/detail/ServiceConfigurationPane" ).getString( "CTL_Name.Text" ) ); GridBagConstraints gbc; gbc = new GridBagConstraints(); gbc.gridx = 0; @@ -224,7 +224,7 @@ import static org.apache.zest.functional.Iterables.first; gbc.fill = GridBagConstraints.VERTICAL; contentPane.add( spacer3, gbc ); final JLabel label2 = new JLabel(); - this.$$$loadLabelText$$$( label2, ResourceBundle.getBundle( "org/qi4j/envisage/detail/ServiceConfigurationPane" ).getString( "CTL_Class.Text" ) ); + this.$$$loadLabelText$$$( label2, ResourceBundle.getBundle( "org/apache/zest/envisage/detail/ServiceConfigurationPane" ).getString( "CTL_Class.Text" ) ); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 3; @@ -245,7 +245,7 @@ import static org.apache.zest.functional.Iterables.first; gbc.fill = GridBagConstraints.VERTICAL; contentPane.add( spacer4, gbc ); linkButton = new JButton(); - this.$$$loadButtonText$$$( linkButton, ResourceBundle.getBundle( "org/qi4j/envisage/detail/ServiceConfigurationPane" ).getString( "CTL_Link.Text" ) ); + this.$$$loadButtonText$$$( linkButton, ResourceBundle.getBundle( "org/apache/zest/envisage/detail/ServiceConfigurationPane" ).getString( "CTL_Link.Text" ) ); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 7; @@ -258,7 +258,7 @@ import static org.apache.zest.functional.Iterables.first; gbc.fill = GridBagConstraints.VERTICAL; contentPane.add( spacer5, gbc ); final JLabel label3 = new JLabel(); - this.$$$loadLabelText$$$( label3, ResourceBundle.getBundle( "org/qi4j/envisage/detail/ServiceConfigurationPane" ).getString( "CTL_Type.Text" ) ); + this.$$$loadLabelText$$$( label3, ResourceBundle.getBundle( "org/apache/zest/envisage/detail/ServiceConfigurationPane" ).getString( "CTL_Type.Text" ) ); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 5; http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/tools/envisage/src/main/java/org/apache/zest/envisage/graph/GraphBuilder.java ---------------------------------------------------------------------- diff --git a/tools/envisage/src/main/java/org/apache/zest/envisage/graph/GraphBuilder.java b/tools/envisage/src/main/java/org/apache/zest/envisage/graph/GraphBuilder.java index 92fd572..470760e 100644 --- a/tools/envisage/src/main/java/org/apache/zest/envisage/graph/GraphBuilder.java +++ b/tools/envisage/src/main/java/org/apache/zest/envisage/graph/GraphBuilder.java @@ -36,7 +36,7 @@ import prefuse.data.Node; import prefuse.data.Table; /** - * Build Qi4J application model as Prefuse Tree Graph + * Build Apache Zest application model as Prefuse Tree Graph */ /* package */ final class GraphBuilder { http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/tools/envisage/src/main/java/org/apache/zest/envisage/graph/GraphPane.java ---------------------------------------------------------------------- diff --git a/tools/envisage/src/main/java/org/apache/zest/envisage/graph/GraphPane.java b/tools/envisage/src/main/java/org/apache/zest/envisage/graph/GraphPane.java index 59c81e0..642cf66 100644 --- a/tools/envisage/src/main/java/org/apache/zest/envisage/graph/GraphPane.java +++ b/tools/envisage/src/main/java/org/apache/zest/envisage/graph/GraphPane.java @@ -99,7 +99,7 @@ public final class GraphPane } ); } - public void initQi4J( ApplicationDetailDescriptor descriptor ) + public void initZest( ApplicationDetailDescriptor descriptor ) { Graph graph = GraphBuilder.buildGraph( descriptor ); Dimension size = getSize(); http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/tools/envisage/src/main/java/org/apache/zest/envisage/tree/StructureModelBuilder.java ---------------------------------------------------------------------- diff --git a/tools/envisage/src/main/java/org/apache/zest/envisage/tree/StructureModelBuilder.java b/tools/envisage/src/main/java/org/apache/zest/envisage/tree/StructureModelBuilder.java index 46e94f8..07e8504 100644 --- a/tools/envisage/src/main/java/org/apache/zest/envisage/tree/StructureModelBuilder.java +++ b/tools/envisage/src/main/java/org/apache/zest/envisage/tree/StructureModelBuilder.java @@ -26,7 +26,7 @@ import org.apache.zest.tools.model.descriptor.*; import org.apache.zest.tools.model.util.DescriptorNameComparator; /** - * Helper class to build tree model for Qi4J model as Structure Tree + * Helper class to build tree model for Apache Zest model as Structure Tree */ /* package */ final class StructureModelBuilder { http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/tools/envisage/src/main/java/org/apache/zest/envisage/tree/TreeModelPane.java ---------------------------------------------------------------------- diff --git a/tools/envisage/src/main/java/org/apache/zest/envisage/tree/TreeModelPane.java b/tools/envisage/src/main/java/org/apache/zest/envisage/tree/TreeModelPane.java index b9375a1..4aa2022 100644 --- a/tools/envisage/src/main/java/org/apache/zest/envisage/tree/TreeModelPane.java +++ b/tools/envisage/src/main/java/org/apache/zest/envisage/tree/TreeModelPane.java @@ -127,11 +127,11 @@ public final class TreeModelPane } /** - * Initialize Qi4J for this component + * Initialize Apache Zest for this component * * @param descriptor the Application descriptor */ - public void initQi4J( ApplicationDetailDescriptor descriptor ) + public void initZest( ApplicationDetailDescriptor descriptor ) { // traverse the model and build JTree representation MutableTreeNode rootNode1 = StructureModelBuilder.build( descriptor ); http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/tools/envisage/src/main/java/org/apache/zest/envisage/tree/TypeModelBuilder.java ---------------------------------------------------------------------- diff --git a/tools/envisage/src/main/java/org/apache/zest/envisage/tree/TypeModelBuilder.java b/tools/envisage/src/main/java/org/apache/zest/envisage/tree/TypeModelBuilder.java index 60c3f70..7252d13 100644 --- a/tools/envisage/src/main/java/org/apache/zest/envisage/tree/TypeModelBuilder.java +++ b/tools/envisage/src/main/java/org/apache/zest/envisage/tree/TypeModelBuilder.java @@ -26,7 +26,7 @@ import org.apache.zest.tools.model.descriptor.*; import org.apache.zest.tools.model.util.DescriptorNameComparator; /** - * Helper class to build tree model for Qi4J model as Type Tree + * Helper class to build tree model for Zest model as Type Tree */ /* package */ final class TypeModelBuilder { http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/tools/envisage/src/main/resources/org/apache/zest/envisage/EnvisageFrame.properties ---------------------------------------------------------------------- diff --git a/tools/envisage/src/main/resources/org/apache/zest/envisage/EnvisageFrame.properties b/tools/envisage/src/main/resources/org/apache/zest/envisage/EnvisageFrame.properties index 639258b..01ee036 100644 --- a/tools/envisage/src/main/resources/org/apache/zest/envisage/EnvisageFrame.properties +++ b/tools/envisage/src/main/resources/org/apache/zest/envisage/EnvisageFrame.properties @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -Application.Title=Qi4J Envisage \ No newline at end of file +Application.Title=Apache Zest Envisage \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/tools/envisage/src/main/resources/org/apache/zest/envisage/detail/DependencyPane.properties ---------------------------------------------------------------------- diff --git a/tools/envisage/src/main/resources/org/apache/zest/envisage/detail/DependencyPane.properties b/tools/envisage/src/main/resources/org/apache/zest/envisage/detail/DependencyPane.properties index 7103ac5..48ec0cf 100644 --- a/tools/envisage/src/main/resources/org/apache/zest/envisage/detail/DependencyPane.properties +++ b/tools/envisage/src/main/resources/org/apache/zest/envisage/detail/DependencyPane.properties @@ -13,11 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -CTL_ClassName.Text = Class Name: -CTL_Optional.Text = Optional: -CTL_Annotation.Text = Annotation: -CTL_Injection.Text = Injection +CTL_ClassName.Text = [CTL_ClassName.Text / org/apache/zest/envisage/detail/DependencyPane] +CTL_Optional.Text = [CTL_Optional.Text / org/apache/zest/envisage/detail/DependencyPane] +CTL_Annotation.Text = [CTL_Annotation.Text / org/apache/zest/envisage/detail/DependencyPane] +CTL_Injection.Text = [CTL_Injection.Text / org/apache/zest/envisage/detail/DependencyPane] CTL_InjectionClass.Text = Class: -CTL_InjectionType.Text = Type: +CTL_InjectionType.Text = [CTL_InjectionType.Text / org/apache/zest/envisage/detail/DependencyPane] CTL_InjectionTypeRaw.Text = Raw: -CTL_InjectedServices.Text=Services: \ No newline at end of file +CTL_InjectedServices.Text=[CTL_InjectedServices.Text / org/apache/zest/envisage/detail/DependencyPane] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/tools/envisage/src/main/resources/org/apache/zest/envisage/detail/ImportedByPane.properties ---------------------------------------------------------------------- diff --git a/tools/envisage/src/main/resources/org/apache/zest/envisage/detail/ImportedByPane.properties b/tools/envisage/src/main/resources/org/apache/zest/envisage/detail/ImportedByPane.properties index 20edb8c..27142a2 100644 --- a/tools/envisage/src/main/resources/org/apache/zest/envisage/detail/ImportedByPane.properties +++ b/tools/envisage/src/main/resources/org/apache/zest/envisage/detail/ImportedByPane.properties @@ -13,5 +13,5 @@ # See the License for the specific language governing permissions and # limitations under the License. -CTL_Name.Text=Name: -CTL_Class.Text=Class: \ No newline at end of file +CTL_Name.Text=[CTL_Name.Text / org/apache/zest/envisage/detail/ImportedByPane] +CTL_Class.Text=[CTL_Class.Text / org/apache/zest/envisage/detail/ImportedByPane] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/tools/envisage/src/main/resources/org/apache/zest/envisage/detail/ServiceConfigurationPane.properties ---------------------------------------------------------------------- diff --git a/tools/envisage/src/main/resources/org/apache/zest/envisage/detail/ServiceConfigurationPane.properties b/tools/envisage/src/main/resources/org/apache/zest/envisage/detail/ServiceConfigurationPane.properties index 3229a12..3f43cde 100644 --- a/tools/envisage/src/main/resources/org/apache/zest/envisage/detail/ServiceConfigurationPane.properties +++ b/tools/envisage/src/main/resources/org/apache/zest/envisage/detail/ServiceConfigurationPane.properties @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -CTL_Name.Text=Name: -CTL_Class.Text=Class: -CTL_Type.Text=Type: -CTL_Link.Text=Goto \ No newline at end of file +CTL_Name.Text=[CTL_Name.Text / org/apache/zest/envisage/detail/ServiceConfigurationPane] +CTL_Class.Text=[CTL_Class.Text / org/apache/zest/envisage/detail/ServiceConfigurationPane] +CTL_Type.Text=[CTL_Type.Text / org/apache/zest/envisage/detail/ServiceConfigurationPane] +CTL_Link.Text=[CTL_Link.Text / org/apache/zest/envisage/detail/ServiceConfigurationPane] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/tools/envisage/src/test/java/org/apache/zest/envisage/sample/EnvisageSample.java ---------------------------------------------------------------------- diff --git a/tools/envisage/src/test/java/org/apache/zest/envisage/sample/EnvisageSample.java b/tools/envisage/src/test/java/org/apache/zest/envisage/sample/EnvisageSample.java index 085f389..ddf04b3 100644 --- a/tools/envisage/src/test/java/org/apache/zest/envisage/sample/EnvisageSample.java +++ b/tools/envisage/src/test/java/org/apache/zest/envisage/sample/EnvisageSample.java @@ -28,13 +28,13 @@ import org.apache.zest.bootstrap.AssemblyException; import org.apache.zest.bootstrap.ModuleAssembly; import org.apache.zest.envisage.Envisage; import org.apache.zest.index.rdf.assembly.RdfMemoryStoreAssembler; -import org.apache.zest.test.AbstractQi4jTest; +import org.apache.zest.test.AbstractZestTest; import org.apache.zest.test.EntityTestAssembler; import static org.apache.zest.test.util.Assume.assumeDisplayPresent; public class EnvisageSample - extends AbstractQi4jTest + extends AbstractZestTest { public static void main( String[] args ) http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/tools/model-detail/build.gradle ---------------------------------------------------------------------- diff --git a/tools/model-detail/build.gradle b/tools/model-detail/build.gradle index 2879371..8a4c1c1 100644 --- a/tools/model-detail/build.gradle +++ b/tools/model-detail/build.gradle @@ -22,12 +22,12 @@ description = "Detailled Model of a Apache Zest⢠Application Structure." jar { manifest { name = "Apache Zest⢠Model Detail" }} dependencies { - compile(project(":org.qi4j.core:org.qi4j.core.bootstrap")) + compile(project(":org.apache.zest.core:org.apache.zest.core.bootstrap")) - testCompile(project(":org.qi4j.core:org.qi4j.core.testsupport")) - testCompile(project(":org.qi4j.extensions:org.qi4j.extension.indexing-rdf")) + testCompile(project(":org.apache.zest.core:org.apache.zest.core.testsupport")) + testCompile(project(":org.apache.zest.extensions:org.apache.zest.extension.indexing-rdf")) - testRuntime(project(":org.qi4j.core:org.qi4j.core.runtime")) + testRuntime(project(":org.apache.zest.core:org.apache.zest.core.runtime")) testRuntime(libraries.logback) } http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/tools/model-detail/dev-status.xml ---------------------------------------------------------------------- diff --git a/tools/model-detail/dev-status.xml b/tools/model-detail/dev-status.xml index 4458bbb..a0d7558 100644 --- a/tools/model-detail/dev-status.xml +++ b/tools/model-detail/dev-status.xml @@ -15,10 +15,10 @@ See the License for the specific language governing permissions and limitations under the License. --> -<module xmlns="http://www.qi4j.org/schemas/2008/dev-status/1" +<module xmlns="http://zest.apache.org/schemas/2008/dev-status/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.qi4j.org/schemas/2008/dev-status/1 - http://www.qi4j.org/schemas/2008/dev-status/1/dev-status.xsd"> + xsi:schemaLocation="http://zest.apache.org/schemas/2008/dev-status/1 + http://zest.apache.org/schemas/2008/dev-status/1/dev-status.xsd"> <status> <!--none,early,beta,stable,mature--> <codebase>stable</codebase> http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/tools/model-detail/src/main/java/org/apache/zest/tools/model/descriptor/ImportedServiceCompositeDescriptor.java ---------------------------------------------------------------------- diff --git a/tools/model-detail/src/main/java/org/apache/zest/tools/model/descriptor/ImportedServiceCompositeDescriptor.java b/tools/model-detail/src/main/java/org/apache/zest/tools/model/descriptor/ImportedServiceCompositeDescriptor.java index 4839084..927e7f2 100644 --- a/tools/model-detail/src/main/java/org/apache/zest/tools/model/descriptor/ImportedServiceCompositeDescriptor.java +++ b/tools/model-detail/src/main/java/org/apache/zest/tools/model/descriptor/ImportedServiceCompositeDescriptor.java @@ -29,7 +29,7 @@ import org.apache.zest.api.util.Classes; import org.apache.zest.functional.Iterables; /** - * XXX Workaround for inconsistency in Qi4J core-api/spi + * XXX Workaround for inconsistency in Zest core-api/spi * ImportedServiceDescriptor wrapper as composite */ public class ImportedServiceCompositeDescriptor http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/tools/model-detail/src/main/java/org/apache/zest/tools/model/descriptor/ImportedServiceDetailDescriptor.java ---------------------------------------------------------------------- diff --git a/tools/model-detail/src/main/java/org/apache/zest/tools/model/descriptor/ImportedServiceDetailDescriptor.java b/tools/model-detail/src/main/java/org/apache/zest/tools/model/descriptor/ImportedServiceDetailDescriptor.java index 194596a..ce3f4c1 100644 --- a/tools/model-detail/src/main/java/org/apache/zest/tools/model/descriptor/ImportedServiceDetailDescriptor.java +++ b/tools/model-detail/src/main/java/org/apache/zest/tools/model/descriptor/ImportedServiceDetailDescriptor.java @@ -30,7 +30,7 @@ import static org.apache.zest.api.util.NullArgumentException.validateNotNull; * <p> * Visitable hierarchy with Activators children. */ -// TODO need to refactor later, but wait until Qi4J core/spi have proper and consistent API for ImportedService. +// TODO need to refactor later, but wait until Zest core/spi have proper and consistent API for ImportedService. public class ImportedServiceDetailDescriptor extends CompositeDetailDescriptor<ImportedServiceCompositeDescriptor> implements ActivateeDetailDescriptor, VisitableHierarchy<Object, Object> http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/tools/qidea/build.gradle ---------------------------------------------------------------------- diff --git a/tools/qidea/build.gradle b/tools/qidea/build.gradle index 559acdb..cc10e44 100644 --- a/tools/qidea/build.gradle +++ b/tools/qidea/build.gradle @@ -22,10 +22,10 @@ description = "IntelliJ IDEA Plugin for Apache Zest⢠development." jar { manifest { name = "Apache Zest⢠IDEA plugin" }} dependencies { - compile(project(":org.qi4j.core:org.qi4j.core.bootstrap")) + compile(project(":org.apache.zest.core:org.apache.zest.core.bootstrap")) - testCompile(project(":org.qi4j.core:org.qi4j.core.testsupport")) + testCompile(project(":org.apache.zest.core:org.apache.zest.core.testsupport")) - testRuntime(project(":org.qi4j.core:org.qi4j.core.runtime")) + testRuntime(project(":org.apache.zest.core:org.apache.zest.core.runtime")) testRuntime(libraries.logback) } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/Qi4jApplicationComponent.java ---------------------------------------------------------------------- diff --git a/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/Qi4jApplicationComponent.java b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/Qi4jApplicationComponent.java deleted file mode 100644 index 9bebb6b..0000000 --- a/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/Qi4jApplicationComponent.java +++ /dev/null @@ -1,131 +0,0 @@ -/* Copyright 2008 Edward Yakop. -* -* 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 org.apache.zest.ide.plugin.idea; - -import com.intellij.codeInspection.InspectionToolProvider; -import com.intellij.facet.FacetTypeRegistry; -import com.intellij.ide.fileTemplates.FileTemplateDescriptor; -import com.intellij.ide.fileTemplates.FileTemplateGroupDescriptor; -import com.intellij.ide.fileTemplates.FileTemplateGroupDescriptorFactory; -import com.intellij.openapi.components.ApplicationComponent; -import com.intellij.openapi.fileTypes.FileTypeManager; -import org.jetbrains.annotations.NonNls; -import org.jetbrains.annotations.NotNull; -import org.apache.zest.ide.plugin.idea.appliesTo.inspections.AppliesToAnnotationDeclaredCorrectlyInspection; -import org.apache.zest.ide.plugin.idea.common.facet.Qi4jFacetType; -import org.apache.zest.ide.plugin.idea.concerns.inspections.ConcernsAnnotationDeclaredCorrectlyInspection; -import org.apache.zest.ide.plugin.idea.injections.invocation.inspections.InvocationAnnotationDeclaredCorrectlyInspection; -import org.apache.zest.ide.plugin.idea.injections.service.inspections.ServiceAnnotationDeclaredCorrectlyInspection; -import org.apache.zest.ide.plugin.idea.injections.structure.inspections.StructureAnnotationDeclaredCorrectlyInspection; -import org.apache.zest.ide.plugin.idea.mixins.inspections.MixinImplementsMixinType; -import org.apache.zest.ide.plugin.idea.mixins.inspections.MixinsAnnotationDeclaredOnMixinType; -import org.apache.zest.ide.plugin.idea.sideEffects.inspections.SideEffectsAnnotationDeclaredCorrectlyInspection; - -import javax.swing.*; - -import static org.apache.zest.ide.plugin.idea.common.resource.Qi4jResourceBundle.message; - -/** - * @author [email protected] - * @since 0.1 - */ -public final class Qi4jApplicationComponent - implements ApplicationComponent, InspectionToolProvider, FileTemplateGroupDescriptorFactory -{ - @NonNls - private static String[] FILE_TEMPLATES = { - "GenericConcernOf.java" - }; - - private final Qi4jFacetType qi4jFacetType; - - public Qi4jApplicationComponent() - { - qi4jFacetType = new Qi4jFacetType(); - } - - @NotNull - public final String getComponentName() - { - return "Qi4jApplicationComponent"; - } - - public final void initComponent() - { - registerFacet(); - registerIntentions(); - } - - private void registerFacet() - { - FacetTypeRegistry facetTypeRegistry = FacetTypeRegistry.getInstance(); - facetTypeRegistry.registerFacetType( qi4jFacetType ); - } - - private void registerIntentions() - { -// IntentionManager intentionManager = IntentionManager.getInstance(); -// intentionManager.registerIntentionAndMetaData( new AddConcernOnType(), "intention.category.control.flow" ); - } - - public final void disposeComponent() - { - unregisterFacet(); - } - - private void unregisterFacet() - { - FacetTypeRegistry facetTypeRegistry = FacetTypeRegistry.getInstance(); - facetTypeRegistry.unregisterFacetType( qi4jFacetType ); - } - - public final Class[] getInspectionClasses() - { - return new Class[]{ - // Concerns - ConcernsAnnotationDeclaredCorrectlyInspection.class, - // Mixins - MixinImplementsMixinType.class, - MixinsAnnotationDeclaredOnMixinType.class, - // Side effects - SideEffectsAnnotationDeclaredCorrectlyInspection.class, - // Injections - InvocationAnnotationDeclaredCorrectlyInspection.class, - ServiceAnnotationDeclaredCorrectlyInspection.class, - StructureAnnotationDeclaredCorrectlyInspection.class, - // AppliesTo - AppliesToAnnotationDeclaredCorrectlyInspection.class - }; - } - - public final FileTemplateGroupDescriptor getFileTemplatesDescriptor() - { - FileTemplateGroupDescriptor group = new FileTemplateGroupDescriptor( - message( "qi4j.file.template.group.title" ), null - ); - - FileTypeManager fileTypeManager = FileTypeManager.getInstance(); - for( @NonNls String template : FILE_TEMPLATES ) - { - Icon icon = fileTypeManager.getFileTypeByFileName( template ).getIcon(); - group.addTemplate( new FileTemplateDescriptor( template, icon ) ); - } - - return group; - } - -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/ZestApplicationComponent.java ---------------------------------------------------------------------- diff --git a/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/ZestApplicationComponent.java b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/ZestApplicationComponent.java new file mode 100644 index 0000000..d3a5ed3 --- /dev/null +++ b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/ZestApplicationComponent.java @@ -0,0 +1,131 @@ +/* Copyright 2008 Edward Yakop. +* +* 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 org.apache.zest.ide.plugin.idea; + +import com.intellij.codeInspection.InspectionToolProvider; +import com.intellij.facet.FacetTypeRegistry; +import com.intellij.ide.fileTemplates.FileTemplateDescriptor; +import com.intellij.ide.fileTemplates.FileTemplateGroupDescriptor; +import com.intellij.ide.fileTemplates.FileTemplateGroupDescriptorFactory; +import com.intellij.openapi.components.ApplicationComponent; +import com.intellij.openapi.fileTypes.FileTypeManager; +import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; +import org.apache.zest.ide.plugin.idea.appliesTo.inspections.AppliesToAnnotationDeclaredCorrectlyInspection; +import org.apache.zest.ide.plugin.idea.common.facet.ZestFacetType; +import org.apache.zest.ide.plugin.idea.concerns.inspections.ConcernsAnnotationDeclaredCorrectlyInspection; +import org.apache.zest.ide.plugin.idea.injections.invocation.inspections.InvocationAnnotationDeclaredCorrectlyInspection; +import org.apache.zest.ide.plugin.idea.injections.service.inspections.ServiceAnnotationDeclaredCorrectlyInspection; +import org.apache.zest.ide.plugin.idea.injections.structure.inspections.StructureAnnotationDeclaredCorrectlyInspection; +import org.apache.zest.ide.plugin.idea.mixins.inspections.MixinImplementsMixinType; +import org.apache.zest.ide.plugin.idea.mixins.inspections.MixinsAnnotationDeclaredOnMixinType; +import org.apache.zest.ide.plugin.idea.sideEffects.inspections.SideEffectsAnnotationDeclaredCorrectlyInspection; + +import javax.swing.*; + +import static org.apache.zest.ide.plugin.idea.common.resource.ZestResourceBundle.message; + +/** + * @author [email protected] + * @since 0.1 + */ +public final class ZestApplicationComponent + implements ApplicationComponent, InspectionToolProvider, FileTemplateGroupDescriptorFactory +{ + @NonNls + private static String[] FILE_TEMPLATES = { + "GenericConcernOf.java" + }; + + private final ZestFacetType zestFacetType; + + public ZestApplicationComponent() + { + zestFacetType = new ZestFacetType(); + } + + @NotNull + public final String getComponentName() + { + return "ZestApplicationComponent"; + } + + public final void initComponent() + { + registerFacet(); + registerIntentions(); + } + + private void registerFacet() + { + FacetTypeRegistry facetTypeRegistry = FacetTypeRegistry.getInstance(); + facetTypeRegistry.registerFacetType( zestFacetType ); + } + + private void registerIntentions() + { +// IntentionManager intentionManager = IntentionManager.getInstance(); +// intentionManager.registerIntentionAndMetaData( new AddConcernOnType(), "intention.category.control.flow" ); + } + + public final void disposeComponent() + { + unregisterFacet(); + } + + private void unregisterFacet() + { + FacetTypeRegistry facetTypeRegistry = FacetTypeRegistry.getInstance(); + facetTypeRegistry.unregisterFacetType( zestFacetType ); + } + + public final Class[] getInspectionClasses() + { + return new Class[]{ + // Concerns + ConcernsAnnotationDeclaredCorrectlyInspection.class, + // Mixins + MixinImplementsMixinType.class, + MixinsAnnotationDeclaredOnMixinType.class, + // Side effects + SideEffectsAnnotationDeclaredCorrectlyInspection.class, + // Injections + InvocationAnnotationDeclaredCorrectlyInspection.class, + ServiceAnnotationDeclaredCorrectlyInspection.class, + StructureAnnotationDeclaredCorrectlyInspection.class, + // AppliesTo + AppliesToAnnotationDeclaredCorrectlyInspection.class + }; + } + + public final FileTemplateGroupDescriptor getFileTemplatesDescriptor() + { + FileTemplateGroupDescriptor group = new FileTemplateGroupDescriptor( + message( "zest.file.template.group.title" ), null + ); + + FileTypeManager fileTypeManager = FileTypeManager.getInstance(); + for( @NonNls String template : FILE_TEMPLATES ) + { + Icon icon = fileTypeManager.getFileTypeByFileName( template ).getIcon(); + group.addTemplate( new FileTemplateDescriptor( template, icon ) ); + } + + return group; + } + +} http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/appliesTo/common/Qi4jAppliesToConstants.java ---------------------------------------------------------------------- diff --git a/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/appliesTo/common/Qi4jAppliesToConstants.java b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/appliesTo/common/Qi4jAppliesToConstants.java deleted file mode 100644 index 745e31b..0000000 --- a/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/appliesTo/common/Qi4jAppliesToConstants.java +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright 2008 Edward Yakop. -* -* 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 org.apache.zest.ide.plugin.idea.appliesTo.common; - -/** - * @author [email protected] - * @since 0.1 - */ -public final class Qi4jAppliesToConstants -{ - public static final String QUALIFIED_NAME_APPLIES_TO = "org.qi4j.api.common.AppliesTo"; - public static final String QUALIFIED_NAME_APPLIES_TO_FILTER = "org.qi4j.api.common.AppliesToFilter"; - - private Qi4jAppliesToConstants() - { - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/appliesTo/common/Qi4jAppliesToUtil.java ---------------------------------------------------------------------- diff --git a/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/appliesTo/common/Qi4jAppliesToUtil.java b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/appliesTo/common/Qi4jAppliesToUtil.java deleted file mode 100644 index 242e4e6..0000000 --- a/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/appliesTo/common/Qi4jAppliesToUtil.java +++ /dev/null @@ -1,136 +0,0 @@ -/* Copyright 2008 Edward Yakop. -* -* 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 org.apache.zest.ide.plugin.idea.appliesTo.common; - -import com.intellij.openapi.project.Project; -import com.intellij.psi.*; -import com.intellij.psi.search.GlobalSearchScope; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.Collections; -import java.util.List; - -import static com.intellij.codeInsight.AnnotationUtil.findAnnotation; -import static java.util.Collections.emptyList; -import static org.apache.zest.ide.plugin.idea.appliesTo.common.Qi4jAppliesToConstants.QUALIFIED_NAME_APPLIES_TO; -import static org.apache.zest.ide.plugin.idea.appliesTo.common.Qi4jAppliesToConstants.QUALIFIED_NAME_APPLIES_TO_FILTER; -import static org.apache.zest.ide.plugin.idea.common.psi.PsiAnnotationUtil.getAnnotationDefaultParameterValue; -import static org.apache.zest.ide.plugin.idea.common.psi.PsiAnnotationUtil.getClassReference; -import static org.apache.zest.ide.plugin.idea.common.psi.PsiClassUtil.getPSIClass; -import static org.apache.zest.ide.plugin.idea.common.psi.search.GlobalSearchScopeUtil.determineSearchScope; - -/** - * @author [email protected] - * @since 0.1 - */ -public final class Qi4jAppliesToUtil -{ - /** - * @param searchContext Search context. - * @return {@code AppliesToFilter} class given the search context. {@code null} if not found. - * @since 0.1 - */ - @Nullable - public static PsiClass getAppliesToFilterClass( @NotNull PsiElement searchContext ) - { - Project project = searchContext.getProject(); - GlobalSearchScope searchScope = determineSearchScope( searchContext ); - return getAppliesToFilterClass( project, searchScope ); - } - - /** - * @param project project. - * @param scope search scope. - * @return {@code AppliesToFilter} class given {@code project} and {@code scope} parameters. - * Returns {@code null} if not found. - * @since 0.1 - */ - @Nullable - public static PsiClass getAppliesToFilterClass( @NotNull Project project, - @Nullable GlobalSearchScope scope ) - { - JavaPsiFacade psiFacade = JavaPsiFacade.getInstance( project ); - return scope == null ? null : psiFacade.findClass( QUALIFIED_NAME_APPLIES_TO_FILTER, scope ); - } - - /** - * @param elementWithinJavaClass element within java class. - * @return {@code @AppliesTo} annotation declaration of the class that contains the element. - * Returns {@code null} if not found, or {@code element} is an invalid context. - * @since 0.1 - */ - @Nullable - public static PsiAnnotation getAppliesToAnnotation( @NotNull PsiElement elementWithinJavaClass ) - { - PsiClass psiClass = getPSIClass( elementWithinJavaClass ); - return findAnnotation( psiClass, QUALIFIED_NAME_APPLIES_TO ); - } - - /** - * @param annotation annotation to process. - * @return {@code @AppliesTo} annotation value. Returns {@link Collections#emptyList()} if {@code annotation} is - * {@code null} or annotation is not a {@code @AppliesTo} annotation. - * @since 0.1 - */ - @NotNull - public static List<PsiAnnotationMemberValue> getAppliesToAnnotationValue( @Nullable PsiAnnotation annotation ) - { - if( annotation == null ) - { - return emptyList(); - } - - String concernsQualifiedName = annotation.getQualifiedName(); - if( !QUALIFIED_NAME_APPLIES_TO.equals( concernsQualifiedName ) ) - { - return emptyList(); - } - - return getAnnotationDefaultParameterValue( annotation ); - } - - /** - * @param value annotation member value. - * @return Applies to class reference given the {@code value} parameter. Returns {@code null} if it's not a - * class reference. - * @since 0.1 - */ - @Nullable - public static PsiJavaCodeReferenceElement getAppliesToValueClassReference( @NotNull PsiAnnotationMemberValue value ) - { - return getClassReference( value ); - } - - /** - * Returns a {@code boolean} indicator whether the specified {@code psiClass} is implements - * {@code AppliesToFilter} class. - * - * @param psiClass class to check. - * @param appliesToFilterClass {@code AppliesToFilter} class. - * @return {@code true} if {@code psiClass} implements {@code AppliesToFilter} class, {@code false} otherwise. - * @since 0.1 - */ - public static boolean isAnAppliesToFilter( @NotNull PsiClass psiClass, @NotNull PsiClass appliesToFilterClass ) - { - return !psiClass.isInterface() && psiClass.isInheritor( appliesToFilterClass, true ); - } - - private Qi4jAppliesToUtil() - { - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/appliesTo/common/ZestAppliesToConstants.java ---------------------------------------------------------------------- diff --git a/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/appliesTo/common/ZestAppliesToConstants.java b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/appliesTo/common/ZestAppliesToConstants.java new file mode 100644 index 0000000..0ac9def --- /dev/null +++ b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/appliesTo/common/ZestAppliesToConstants.java @@ -0,0 +1,31 @@ +/* Copyright 2008 Edward Yakop. +* +* 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 org.apache.zest.ide.plugin.idea.appliesTo.common; + +/** + * @author [email protected] + * @since 0.1 + */ +public final class ZestAppliesToConstants +{ + public static final String QUALIFIED_NAME_APPLIES_TO = "org.apache.zest.api.common.AppliesTo"; + public static final String QUALIFIED_NAME_APPLIES_TO_FILTER = "org.apache.zest.api.common.AppliesToFilter"; + + private ZestAppliesToConstants() + { + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/appliesTo/common/ZestAppliesToUtil.java ---------------------------------------------------------------------- diff --git a/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/appliesTo/common/ZestAppliesToUtil.java b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/appliesTo/common/ZestAppliesToUtil.java new file mode 100644 index 0000000..b127cbf --- /dev/null +++ b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/appliesTo/common/ZestAppliesToUtil.java @@ -0,0 +1,136 @@ +/* Copyright 2008 Edward Yakop. +* +* 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 org.apache.zest.ide.plugin.idea.appliesTo.common; + +import com.intellij.openapi.project.Project; +import com.intellij.psi.*; +import com.intellij.psi.search.GlobalSearchScope; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.Collections; +import java.util.List; + +import static com.intellij.codeInsight.AnnotationUtil.findAnnotation; +import static java.util.Collections.emptyList; +import static org.apache.zest.ide.plugin.idea.appliesTo.common.ZestAppliesToConstants.QUALIFIED_NAME_APPLIES_TO; +import static org.apache.zest.ide.plugin.idea.appliesTo.common.ZestAppliesToConstants.QUALIFIED_NAME_APPLIES_TO_FILTER; +import static org.apache.zest.ide.plugin.idea.common.psi.PsiAnnotationUtil.getAnnotationDefaultParameterValue; +import static org.apache.zest.ide.plugin.idea.common.psi.PsiAnnotationUtil.getClassReference; +import static org.apache.zest.ide.plugin.idea.common.psi.PsiClassUtil.getPSIClass; +import static org.apache.zest.ide.plugin.idea.common.psi.search.GlobalSearchScopeUtil.determineSearchScope; + +/** + * @author [email protected] + * @since 0.1 + */ +public final class ZestAppliesToUtil +{ + /** + * @param searchContext Search context. + * @return {@code AppliesToFilter} class given the search context. {@code null} if not found. + * @since 0.1 + */ + @Nullable + public static PsiClass getAppliesToFilterClass( @NotNull PsiElement searchContext ) + { + Project project = searchContext.getProject(); + GlobalSearchScope searchScope = determineSearchScope( searchContext ); + return getAppliesToFilterClass( project, searchScope ); + } + + /** + * @param project project. + * @param scope search scope. + * @return {@code AppliesToFilter} class given {@code project} and {@code scope} parameters. + * Returns {@code null} if not found. + * @since 0.1 + */ + @Nullable + public static PsiClass getAppliesToFilterClass( @NotNull Project project, + @Nullable GlobalSearchScope scope ) + { + JavaPsiFacade psiFacade = JavaPsiFacade.getInstance( project ); + return scope == null ? null : psiFacade.findClass( QUALIFIED_NAME_APPLIES_TO_FILTER, scope ); + } + + /** + * @param elementWithinJavaClass element within java class. + * @return {@code @AppliesTo} annotation declaration of the class that contains the element. + * Returns {@code null} if not found, or {@code element} is an invalid context. + * @since 0.1 + */ + @Nullable + public static PsiAnnotation getAppliesToAnnotation( @NotNull PsiElement elementWithinJavaClass ) + { + PsiClass psiClass = getPSIClass( elementWithinJavaClass ); + return findAnnotation( psiClass, QUALIFIED_NAME_APPLIES_TO ); + } + + /** + * @param annotation annotation to process. + * @return {@code @AppliesTo} annotation value. Returns {@link Collections#emptyList()} if {@code annotation} is + * {@code null} or annotation is not a {@code @AppliesTo} annotation. + * @since 0.1 + */ + @NotNull + public static List<PsiAnnotationMemberValue> getAppliesToAnnotationValue( @Nullable PsiAnnotation annotation ) + { + if( annotation == null ) + { + return emptyList(); + } + + String concernsQualifiedName = annotation.getQualifiedName(); + if( !QUALIFIED_NAME_APPLIES_TO.equals( concernsQualifiedName ) ) + { + return emptyList(); + } + + return getAnnotationDefaultParameterValue( annotation ); + } + + /** + * @param value annotation member value. + * @return Applies to class reference given the {@code value} parameter. Returns {@code null} if it's not a + * class reference. + * @since 0.1 + */ + @Nullable + public static PsiJavaCodeReferenceElement getAppliesToValueClassReference( @NotNull PsiAnnotationMemberValue value ) + { + return getClassReference( value ); + } + + /** + * Returns a {@code boolean} indicator whether the specified {@code psiClass} is implements + * {@code AppliesToFilter} class. + * + * @param psiClass class to check. + * @param appliesToFilterClass {@code AppliesToFilter} class. + * @return {@code true} if {@code psiClass} implements {@code AppliesToFilter} class, {@code false} otherwise. + * @since 0.1 + */ + public static boolean isAnAppliesToFilter( @NotNull PsiClass psiClass, @NotNull PsiClass appliesToFilterClass ) + { + return !psiClass.isInterface() && psiClass.isInheritor( appliesToFilterClass, true ); + } + + private ZestAppliesToUtil() + { + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/appliesTo/inspections/AppliesToAnnotationDeclaredCorrectlyInspection.java ---------------------------------------------------------------------- diff --git a/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/appliesTo/inspections/AppliesToAnnotationDeclaredCorrectlyInspection.java b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/appliesTo/inspections/AppliesToAnnotationDeclaredCorrectlyInspection.java index 08641e8..3757117 100644 --- a/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/appliesTo/inspections/AppliesToAnnotationDeclaredCorrectlyInspection.java +++ b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/appliesTo/inspections/AppliesToAnnotationDeclaredCorrectlyInspection.java @@ -29,14 +29,14 @@ import java.util.LinkedList; import java.util.List; import static com.intellij.codeInspection.ProblemHighlightType.GENERIC_ERROR_OR_WARNING; -import static org.apache.zest.ide.plugin.idea.appliesTo.common.Qi4jAppliesToUtil.*; +import static org.apache.zest.ide.plugin.idea.appliesTo.common.ZestAppliesToUtil.*; import static org.apache.zest.ide.plugin.idea.common.psi.PsiClassUtil.isImplementsInvocationHandler; import static org.apache.zest.ide.plugin.idea.common.psi.search.GlobalSearchScopeUtil.determineSearchScope; -import static org.apache.zest.ide.plugin.idea.common.resource.Qi4jResourceBundle.message; -import static org.apache.zest.ide.plugin.idea.concerns.common.Qi4jConcernUtil.isAConcern; -import static org.apache.zest.ide.plugin.idea.concerns.common.Qi4jConcernUtil.isAGenericConcern; -import static org.apache.zest.ide.plugin.idea.sideEffects.common.Qi4jSideEffectUtil.isAGenericSideEffect; -import static org.apache.zest.ide.plugin.idea.sideEffects.common.Qi4jSideEffectUtil.isASideEffect; +import static org.apache.zest.ide.plugin.idea.common.resource.ZestResourceBundle.message; +import static org.apache.zest.ide.plugin.idea.concerns.common.ZestConcernUtil.isAConcern; +import static org.apache.zest.ide.plugin.idea.concerns.common.ZestConcernUtil.isAGenericConcern; +import static org.apache.zest.ide.plugin.idea.sideEffects.common.ZestSideEffectUtil.isAGenericSideEffect; +import static org.apache.zest.ide.plugin.idea.sideEffects.common.ZestSideEffectUtil.isASideEffect; /** * @author [email protected] http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/common/actions/Qi4jCreateActionGroup.java ---------------------------------------------------------------------- diff --git a/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/common/actions/Qi4jCreateActionGroup.java b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/common/actions/Qi4jCreateActionGroup.java deleted file mode 100644 index 1899b51..0000000 --- a/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/common/actions/Qi4jCreateActionGroup.java +++ /dev/null @@ -1,80 +0,0 @@ -/* Copyright 2008 Edward Yakop. -* -* 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 org.apache.zest.ide.plugin.idea.common.actions; - -import com.intellij.ide.IdeView; -import com.intellij.openapi.actionSystem.*; -import com.intellij.openapi.module.Module; -import com.intellij.openapi.project.Project; -import com.intellij.openapi.roots.ProjectFileIndex; -import com.intellij.openapi.roots.ProjectRootManager; -import com.intellij.psi.JavaDirectoryService; -import com.intellij.psi.PsiDirectory; - -import static org.apache.zest.ide.plugin.idea.common.resource.Qi4jResourceBundle.message; - -/** - * @author [email protected] - * @since 0.1 - */ -public final class Qi4jCreateActionGroup extends DefaultActionGroup -{ - public Qi4jCreateActionGroup() - { - super( message( "qi4j.action.group.title" ), true ); - getTemplatePresentation().setDescription( message( "qi4j.action.group.description" ) ); - } - - public void update( AnActionEvent e ) - { - Presentation presentation = e.getPresentation(); - presentation.setVisible( shouldActionGroupVisible( e ) ); - } - - private boolean shouldActionGroupVisible( AnActionEvent e ) - { - Module module = e.getData( LangDataKeys.MODULE ); - if( module == null ) - { - return false; - } - - // TODO: Enable this once Qi4jFacet can be automatically added/removed -// if( Qi4jFacet.getInstance( module ) == null ) -// { -// return false; -// } - - // Are we on IDE View and under project source folder? - Project project = e.getData( PlatformDataKeys.PROJECT ); - IdeView view = e.getData( LangDataKeys.IDE_VIEW ); - if( view != null && project != null ) - { - ProjectFileIndex projectFileIndex = ProjectRootManager.getInstance( project ).getFileIndex(); - PsiDirectory[] dirs = view.getDirectories(); - for( PsiDirectory dir : dirs ) - { - if( projectFileIndex.isInSourceContent( dir.getVirtualFile() ) && JavaDirectoryService.getInstance().getPackage( dir ) != null ) - { - return true; - } - } - } - - return false; - } -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/common/actions/ZestCreateActionGroup.java ---------------------------------------------------------------------- diff --git a/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/common/actions/ZestCreateActionGroup.java b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/common/actions/ZestCreateActionGroup.java new file mode 100644 index 0000000..ba87d80 --- /dev/null +++ b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/common/actions/ZestCreateActionGroup.java @@ -0,0 +1,80 @@ +/* Copyright 2008 Edward Yakop. +* +* 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 org.apache.zest.ide.plugin.idea.common.actions; + +import com.intellij.ide.IdeView; +import com.intellij.openapi.actionSystem.*; +import com.intellij.openapi.module.Module; +import com.intellij.openapi.project.Project; +import com.intellij.openapi.roots.ProjectFileIndex; +import com.intellij.openapi.roots.ProjectRootManager; +import com.intellij.psi.JavaDirectoryService; +import com.intellij.psi.PsiDirectory; + +import static org.apache.zest.ide.plugin.idea.common.resource.ZestResourceBundle.message; + +/** + * @author [email protected] + * @since 0.1 + */ +public final class ZestCreateActionGroup extends DefaultActionGroup +{ + public ZestCreateActionGroup() + { + super( message( "zest.action.group.title" ), true ); + getTemplatePresentation().setDescription( message( "zest.action.group.description" ) ); + } + + public void update( AnActionEvent e ) + { + Presentation presentation = e.getPresentation(); + presentation.setVisible( shouldActionGroupVisible( e ) ); + } + + private boolean shouldActionGroupVisible( AnActionEvent e ) + { + Module module = e.getData( LangDataKeys.MODULE ); + if( module == null ) + { + return false; + } + + // TODO: Enable this once ZestFacet can be automatically added/removed +// if( ZestFacet.getInstance( module ) == null ) +// { +// return false; +// } + + // Are we on IDE View and under project source folder? + Project project = e.getData( PlatformDataKeys.PROJECT ); + IdeView view = e.getData( LangDataKeys.IDE_VIEW ); + if( view != null && project != null ) + { + ProjectFileIndex projectFileIndex = ProjectRootManager.getInstance( project ).getFileIndex(); + PsiDirectory[] dirs = view.getDirectories(); + for( PsiDirectory dir : dirs ) + { + if( projectFileIndex.isInSourceContent( dir.getVirtualFile() ) && JavaDirectoryService.getInstance().getPackage( dir ) != null ) + { + return true; + } + } + } + + return false; + } +} http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/common/facet/Qi4jFacet.java ---------------------------------------------------------------------- diff --git a/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/common/facet/Qi4jFacet.java b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/common/facet/Qi4jFacet.java deleted file mode 100644 index eb6d706..0000000 --- a/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/common/facet/Qi4jFacet.java +++ /dev/null @@ -1,47 +0,0 @@ -/* Copyright 2008 Edward Yakop. -* -* 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 org.apache.zest.ide.plugin.idea.common.facet; - -import com.intellij.facet.Facet; -import com.intellij.facet.FacetManager; -import com.intellij.facet.FacetType; -import com.intellij.openapi.module.Module; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -/** - * @author [email protected] - * @since 0.1 - */ -public final class Qi4jFacet extends Facet<Qi4jFacetConfiguration> -{ - public Qi4jFacet( @NotNull FacetType facetType, - @NotNull Module module, - String name, - @NotNull Qi4jFacetConfiguration configuration, - Facet underlyingFacet ) - { - super( facetType, module, name, configuration, underlyingFacet ); - } - - @Nullable - public static Qi4jFacet getInstance( @NotNull Module module ) - { - return FacetManager.getInstance( module ).getFacetByType( Qi4jFacetType.ID ); - } - -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/common/facet/Qi4jFacetConfiguration.java ---------------------------------------------------------------------- diff --git a/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/common/facet/Qi4jFacetConfiguration.java b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/common/facet/Qi4jFacetConfiguration.java deleted file mode 100644 index fd03600..0000000 --- a/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/common/facet/Qi4jFacetConfiguration.java +++ /dev/null @@ -1,54 +0,0 @@ -/* Copyright 2008 Edward Yakop. -* -* 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 org.apache.zest.ide.plugin.idea.common.facet; - -import com.intellij.facet.FacetConfiguration; -import com.intellij.facet.ui.FacetEditorContext; -import com.intellij.facet.ui.FacetEditorTab; -import com.intellij.facet.ui.FacetValidatorsManager; -import com.intellij.openapi.util.InvalidDataException; -import com.intellij.openapi.util.WriteExternalException; -import org.jdom.Element; -import org.apache.zest.ide.plugin.idea.common.facet.ui.Qi4jFacetEditorTab; - -/** - * @author [email protected] - * @since 0.1 - */ -public final class Qi4jFacetConfiguration - implements FacetConfiguration -{ - public FacetEditorTab[] createEditorTabs( FacetEditorContext editorContext, - FacetValidatorsManager validatorsManager ) - { - return new FacetEditorTab[]{ - new Qi4jFacetEditorTab( editorContext ) - }; - } - - public final void readExternal( Element element ) - throws InvalidDataException - { - // Do nothing - } - - public final void writeExternal( Element element ) - throws WriteExternalException - { - // Do nothing - } -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/common/facet/Qi4jFacetType.java ---------------------------------------------------------------------- diff --git a/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/common/facet/Qi4jFacetType.java b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/common/facet/Qi4jFacetType.java deleted file mode 100644 index 06af246..0000000 --- a/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/common/facet/Qi4jFacetType.java +++ /dev/null @@ -1,120 +0,0 @@ -/* Copyright 2008 Edward Yakop. -* -* 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 org.apache.zest.ide.plugin.idea.common.facet; - -import com.intellij.facet.Facet; -import com.intellij.facet.FacetType; -import com.intellij.facet.FacetTypeId; -import com.intellij.facet.autodetecting.FacetDetector; -import com.intellij.facet.autodetecting.FacetDetectorRegistry; -import com.intellij.openapi.fileTypes.StdFileTypes; -import com.intellij.openapi.module.JavaModuleType; -import com.intellij.openapi.module.Module; -import com.intellij.openapi.module.ModuleType; -import com.intellij.openapi.util.Condition; -import com.intellij.openapi.vfs.VirtualFileFilter; -import com.intellij.psi.JavaElementVisitor; -import com.intellij.psi.PsiFile; -import com.intellij.psi.PsiImportStatement; -import com.intellij.psi.PsiReferenceExpression; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.Collection; - -/** - * @author [email protected] - * @since 0.1 - */ -public final class Qi4jFacetType extends FacetType<Qi4jFacet, Qi4jFacetConfiguration> -{ - public static final FacetTypeId<Qi4jFacet> ID = new FacetTypeId<Qi4jFacet>(); - - public Qi4jFacetType() - { - super( ID, "Qi4jFacet", "Zest Facet" ); - } - - public final Qi4jFacetConfiguration createDefaultConfiguration() - { - return new Qi4jFacetConfiguration(); - } - - public final Qi4jFacet createFacet( @NotNull Module module, - String name, - @NotNull Qi4jFacetConfiguration configuration, - @Nullable Facet underlyingFacet ) - { - return new Qi4jFacet( this, module, name, configuration, underlyingFacet ); - } - - public final boolean isSuitableModuleType( ModuleType moduleType ) - { - return moduleType instanceof JavaModuleType; - } - - @Override - public final void registerDetectors( FacetDetectorRegistry<Qi4jFacetConfiguration> registry ) - { - registry.registerOnTheFlyDetector( - StdFileTypes.JAVA, VirtualFileFilter.ALL, new HasQi4jImportPackageCondition(), - new FacetDetector<PsiFile, Qi4jFacetConfiguration>( "Qi4jFacetDetector" ) - { - @Override - public Qi4jFacetConfiguration detectFacet( PsiFile source, - Collection<Qi4jFacetConfiguration> existingConfigurations ) - { - if( !existingConfigurations.isEmpty() ) - { - return existingConfigurations.iterator().next(); - } - - return createDefaultConfiguration(); - } - } - ); - } - - private static class HasQi4jImportPackageCondition - implements Condition<PsiFile> - { - public final boolean value( PsiFile psiFile ) - { - final boolean[] hasQi4jImportPackage = new boolean[]{ false }; - - psiFile.accept( new JavaElementVisitor() - { - @Override - public final void visitImportStatement( PsiImportStatement statement ) - { - String packageName = statement.getQualifiedName(); - if( packageName != null && packageName.startsWith( "org.qi4j" ) ) - { - hasQi4jImportPackage[ 0 ] = true; - } - } - - @Override - public void visitReferenceExpression( PsiReferenceExpression expression ) - { - // Ignore - } - } ); - return hasQi4jImportPackage[ 0 ]; - } - } -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/common/facet/ZestFacet.java ---------------------------------------------------------------------- diff --git a/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/common/facet/ZestFacet.java b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/common/facet/ZestFacet.java new file mode 100644 index 0000000..128877b --- /dev/null +++ b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/common/facet/ZestFacet.java @@ -0,0 +1,48 @@ +/* Copyright 2008 Edward Yakop. +* +* 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 org.apache.zest.ide.plugin.idea.common.facet; + +import com.intellij.facet.Facet; +import com.intellij.facet.FacetManager; +import com.intellij.facet.FacetType; +import com.intellij.openapi.module.Module; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * @author [email protected] + * @since 0.1 + */ +public final class ZestFacet extends Facet<ZestFacetConfiguration> +{ + public ZestFacet( @NotNull FacetType facetType, + @NotNull Module module, + String name, + @NotNull ZestFacetConfiguration configuration, + Facet underlyingFacet + ) + { + super( facetType, module, name, configuration, underlyingFacet ); + } + + @Nullable + public static ZestFacet getInstance( @NotNull Module module ) + { + return FacetManager.getInstance( module ).getFacetByType( ZestFacetType.ID ); + } + +} http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/common/facet/ZestFacetConfiguration.java ---------------------------------------------------------------------- diff --git a/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/common/facet/ZestFacetConfiguration.java b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/common/facet/ZestFacetConfiguration.java new file mode 100644 index 0000000..24e011f --- /dev/null +++ b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/common/facet/ZestFacetConfiguration.java @@ -0,0 +1,54 @@ +/* Copyright 2008 Edward Yakop. +* +* 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 org.apache.zest.ide.plugin.idea.common.facet; + +import com.intellij.facet.FacetConfiguration; +import com.intellij.facet.ui.FacetEditorContext; +import com.intellij.facet.ui.FacetEditorTab; +import com.intellij.facet.ui.FacetValidatorsManager; +import com.intellij.openapi.util.InvalidDataException; +import com.intellij.openapi.util.WriteExternalException; +import org.jdom.Element; +import org.apache.zest.ide.plugin.idea.common.facet.ui.ZestFacetEditorTab; + +/** + * @author [email protected] + * @since 0.1 + */ +public final class ZestFacetConfiguration + implements FacetConfiguration +{ + public FacetEditorTab[] createEditorTabs( FacetEditorContext editorContext, + FacetValidatorsManager validatorsManager ) + { + return new FacetEditorTab[]{ + new ZestFacetEditorTab( editorContext ) + }; + } + + public final void readExternal( Element element ) + throws InvalidDataException + { + // Do nothing + } + + public final void writeExternal( Element element ) + throws WriteExternalException + { + // Do nothing + } +} http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/common/facet/ZestFacetType.java ---------------------------------------------------------------------- diff --git a/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/common/facet/ZestFacetType.java b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/common/facet/ZestFacetType.java new file mode 100644 index 0000000..4fce184 --- /dev/null +++ b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/common/facet/ZestFacetType.java @@ -0,0 +1,120 @@ +/* Copyright 2008 Edward Yakop. +* +* 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 org.apache.zest.ide.plugin.idea.common.facet; + +import com.intellij.facet.Facet; +import com.intellij.facet.FacetType; +import com.intellij.facet.FacetTypeId; +import com.intellij.facet.autodetecting.FacetDetector; +import com.intellij.facet.autodetecting.FacetDetectorRegistry; +import com.intellij.openapi.fileTypes.StdFileTypes; +import com.intellij.openapi.module.JavaModuleType; +import com.intellij.openapi.module.Module; +import com.intellij.openapi.module.ModuleType; +import com.intellij.openapi.util.Condition; +import com.intellij.openapi.vfs.VirtualFileFilter; +import com.intellij.psi.JavaElementVisitor; +import com.intellij.psi.PsiFile; +import com.intellij.psi.PsiImportStatement; +import com.intellij.psi.PsiReferenceExpression; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.Collection; + +/** + * @author [email protected] + * @since 0.1 + */ +public final class ZestFacetType extends FacetType<ZestFacet, ZestFacetConfiguration> +{ + public static final FacetTypeId<ZestFacet> ID = new FacetTypeId<ZestFacet>(); + + public ZestFacetType() + { + super( ID, "ZestFacet", "Zest Facet" ); + } + + public final ZestFacetConfiguration createDefaultConfiguration() + { + return new ZestFacetConfiguration(); + } + + public final ZestFacet createFacet( @NotNull Module module, + String name, + @NotNull ZestFacetConfiguration configuration, + @Nullable Facet underlyingFacet ) + { + return new ZestFacet( this, module, name, configuration, underlyingFacet ); + } + + public final boolean isSuitableModuleType( ModuleType moduleType ) + { + return moduleType instanceof JavaModuleType; + } + + @Override + public final void registerDetectors( FacetDetectorRegistry<ZestFacetConfiguration> registry ) + { + registry.registerOnTheFlyDetector( + StdFileTypes.JAVA, VirtualFileFilter.ALL, new HasZestImportPackageCondition(), + new FacetDetector<PsiFile, ZestFacetConfiguration>( "ZestFacetDetector" ) + { + @Override + public ZestFacetConfiguration detectFacet( PsiFile source, + Collection<ZestFacetConfiguration> existingConfigurations ) + { + if( !existingConfigurations.isEmpty() ) + { + return existingConfigurations.iterator().next(); + } + + return createDefaultConfiguration(); + } + } + ); + } + + private static class HasZestImportPackageCondition + implements Condition<PsiFile> + { + public final boolean value( PsiFile psiFile ) + { + final boolean[] hasZestImportPackage = new boolean[]{ false }; + + psiFile.accept( new JavaElementVisitor() + { + @Override + public final void visitImportStatement( PsiImportStatement statement ) + { + String packageName = statement.getQualifiedName(); + if( packageName != null && packageName.startsWith( "org.apache.zest" ) ) + { + hasZestImportPackage[ 0 ] = true; + } + } + + @Override + public void visitReferenceExpression( PsiReferenceExpression expression ) + { + // Ignore + } + } ); + return hasZestImportPackage[ 0 ]; + } + } +} http://git-wip-us.apache.org/repos/asf/zest-java/blob/ab97249b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/common/facet/ui/Qi4jFacetEditorTab.java ---------------------------------------------------------------------- diff --git a/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/common/facet/ui/Qi4jFacetEditorTab.java b/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/common/facet/ui/Qi4jFacetEditorTab.java deleted file mode 100644 index 7e73b49..0000000 --- a/tools/qidea/src/main/java/org/apache/zest/ide/plugin/idea/common/facet/ui/Qi4jFacetEditorTab.java +++ /dev/null @@ -1,70 +0,0 @@ -/* Copyright 2008 Edward Yakop. -* -* 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 org.apache.zest.ide.plugin.idea.common.facet.ui; - -import com.intellij.facet.ui.FacetEditorContext; -import com.intellij.facet.ui.FacetEditorTab; -import com.intellij.openapi.options.ConfigurationException; -import org.jetbrains.annotations.Nls; - -import javax.swing.*; - -/** - * @author [email protected] - * @since 0.1 - */ -public final class Qi4jFacetEditorTab extends FacetEditorTab -{ - private final FacetEditorContext editorContext; - - public Qi4jFacetEditorTab( FacetEditorContext aContext ) - { - editorContext = aContext; - } - - @Nls - public final String getDisplayName() - { - return "Zest"; - } - - public JComponent createComponent() - { - return new JPanel(); - } - - public final boolean isModified() - { - return false; - } - - public final void apply() - throws ConfigurationException - { - // From UI to configuration - } - - public final void reset() - { - // From Configuration to UI - } - - public final void disposeUIResources() - { - // Do nothing for now - } -}
