(netbeans) branch master updated: Allow for creating Micronaut Controllers based on Data Repository interfaces.

2023-11-19 Thread dbalek
This is an automated email from the ASF dual-hosted git repository.

dbalek pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
 new 44de9726dd Allow for creating Micronaut Controllers based on Data 
Repository interfaces.
 new f6083fc341 Merge pull request #6702 from 
dbalek/dbalek/micronaut-controllers-from-repositories
44de9726dd is described below

commit 44de9726ddae5112921821b046b003e285766bd8
Author: Dusan Balek 
AuthorDate: Wed Nov 15 14:25:30 2023 +0100

Allow for creating Micronaut Controllers based on Data Repository 
interfaces.
---
 .../modules/micronaut/db/Bundle.properties |  24 ++-
 ...ClassesPanel.form => ClassesSelectorPanel.form} |  63 +++---
 ...ClassesPanel.java => ClassesSelectorPanel.java} | 223 -
 .../modules/micronaut/db/MicronautController.java  | 196 +++---
 .../modules/micronaut/db/MicronautRepository.java  |  21 +-
 .../modules/micronaut/resources/Controller.html|   4 +-
 6 files changed, 354 insertions(+), 177 deletions(-)

diff --git 
a/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/Bundle.properties 
b/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/Bundle.properties
index 9363d7ff68..3fe100ed34 100644
--- 
a/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/Bundle.properties
+++ 
b/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/Bundle.properties
@@ -16,7 +16,7 @@
 # under the License.
 
 Templates/Micronaut=Micronaut
-Templates/Micronaut/Controller=Micronaut Controller Class
+Templates/Micronaut/Controller=Micronaut Controller Classes (from Data 
Repositories)
 Templates/Micronaut/Entity=Micronaut Data Entity Classes from Database
 Templates/Micronaut/Repository=Micronaut Data Repository Interfaces from 
Entities
 
@@ -30,19 +30,33 @@ MSG_PK_Class=Primary Key class {0} for entity class {1}\n
 
 USG_PERSISTENCE_ENTITY_DB_CREATED={0} entity classes was generated from db
 
-LBL_EntityClasses=Entity Classes
+LBL_Entities=Entity Classes
 LBL_AvailableEntities=Available  Classes:
 TXT_AvailableEntities=Available Entity Classes
 ACSN_AvailableEntities=Available entity classes
 ACSD_AvailableEntities=List of all available entity classes
 LBL_SelectedEntities=S Entity Classes:
 TXT_SelectedEntities=Selected Entity Classes
+ACSN_SelectedEntities=Selected entity classes
+ACSD_SelectedEntities=List of selected entity classes
+
+LBL_Repositories=Repository Interfaces
+LBL_AvailableRepositories=Available Repository :
+TXT_AvailableRepositories=Available Repository Interfaces
+ACSN_AvailableRepositories=Available repository interfaces
+ACSD_AvailableRepositories=List of all available repository interfaces
+LBL_SelectedRepositories=S Repository Interfaces:
+TXT_SelectedRepositories=Selected Repository Interfaces
+ACSN_SelectedRepositories=Selected repository interfaces
+ACSD_SelectedRepositories=List of selected repository interfaces
+
 LBL_AddAll=Add A >>
 LBL_Add= >
 LBL_Remove=< 
 LBL_RemoveAll=<< Re All
-ACSN_SelectedEntities=Selected entity classes
-ACSD_SelectedEntities=List of selected entity classes
+
 ERR_SelectEntities=Select at least one entity class
 # {0} = project name
-ERR_NoEntities=No entity class found in {0}
\ No newline at end of file
+ERR_NoEntities=No entity class found in {0}
+# {0} = project name
+ERR_NoRepositories=No repository interface found in {0}
\ No newline at end of file
diff --git 
a/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/EntityClassesPanel.form
 
b/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/ClassesSelectorPanel.form
similarity index 80%
rename from 
enterprise/micronaut/src/org/netbeans/modules/micronaut/db/EntityClassesPanel.form
rename to 
enterprise/micronaut/src/org/netbeans/modules/micronaut/db/ClassesSelectorPanel.form
index 0a3bcbb9cf..7ce55b6e3c 100644
--- 
a/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/EntityClassesPanel.form
+++ 
b/enterprise/micronaut/src/org/netbeans/modules/micronaut/db/ClassesSelectorPanel.form
@@ -26,8 +26,8 @@
 
   
 
-
-  
+
+  
 
 
   
@@ -48,33 +48,28 @@
 
   
   
-
-  
-
-  
-
-  
+
   
-
+
   
   
 
-  
+  
 
   
 
   
   
-
+
   
 
-  
+  
 
-
-  
+
+  
 
-
-  
+
+  
 
   
   
@@ -83,7 +78,7 @@
 
   
 
-
+
   
 
   
@@ -100,18 +95,18 @@
 
   
   
-
+
   
 
   
 
   
   
-
-  

(netbeans) branch php-nb21-features updated: Fix the formatting for a method invocation with a ternary or null-coalescing operator #5380

2023-11-19 Thread junichi11
This is an automated email from the ASF dual-hosted git repository.

junichi11 pushed a commit to branch php-nb21-features
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/php-nb21-features by this push:
 new 76d2feab8a Fix the formatting for a method invocation with a ternary 
or null-coalescing operator #5380
 new d3ebc8be92 Merge pull request #6724 from 
junichi11/php-gh-5380-ternary-formatting
76d2feab8a is described below

commit 76d2feab8adca311184866f81723d7e1b8566576
Author: Junichi Yamamoto 
AuthorDate: Sun Nov 19 11:12:45 2023 +0900

Fix the formatting for a method invocation with a ternary or 
null-coalescing operator #5380

- https://github.com/apache/netbeans/issues/5380
- Add whitespaces after `UNBREAKABLE_SEQUENCE_END` token
- Check whether there is a whitespace token before an indent token
- Add unit tests
---
 .../modules/php/editor/indent/FormatVisitor.java   | 11 ++
 .../formatting/broken/issue197074_04.php.formatted |  6 +++---
 .../data/testfiles/formatting/spaces/gh5380_01.php | 23 +
 .../spaces/gh5380_01.php.testGH5380_01a.formatted  | 24 ++
 .../spaces/gh5380_01.php.testGH5380_01b.formatted  | 24 ++
 .../data/testfiles/formatting/spaces/gh5380_02.php | 23 +
 .../spaces/gh5380_02.php.testGH5380_02a.formatted  | 24 ++
 .../spaces/gh5380_02.php.testGH5380_02b.formatted  | 24 ++
 .../php/editor/indent/PHPFormatterSpacesTest.java  | 23 +
 9 files changed, 179 insertions(+), 3 deletions(-)

diff --git 
a/php/php.editor/src/org/netbeans/modules/php/editor/indent/FormatVisitor.java 
b/php/php.editor/src/org/netbeans/modules/php/editor/indent/FormatVisitor.java
index 2913ec7a66..caa0d307c9 100644
--- 
a/php/php.editor/src/org/netbeans/modules/php/editor/indent/FormatVisitor.java
+++ 
b/php/php.editor/src/org/netbeans/modules/php/editor/indent/FormatVisitor.java
@@ -3133,6 +3133,17 @@ public class FormatVisitor extends DefaultVisitor {
 removedWS = formatTokens.remove(formatTokens.size() - 1);
 index--;
 lastToken = formatTokens.get(index);
+} else if (lastToken.getId() == FormatToken.Kind.INDENT) {
+// GH-5380 there are whitespaces before ")" in the method 
invocation with ternary or null-coalescing operator
+// e.g. var_dump($a ? 1 : 2  ); var_dump($a ?? null);
+if (index - 1 > 0) {
+FormatToken possibleWSToken = formatTokens.get(index -1);
+if (possibleWSToken.isWhitespace()) {
+removedWS = formatTokens.remove(index - 1);
+index -= 2;
+lastToken = formatTokens.get(index);
+}
+}
 }
 
 if (lastToken.getId() == FormatToken.Kind.WHITESPACE_AFTER_COMMA) {
diff --git 
a/php/php.editor/test/unit/data/testfiles/formatting/broken/issue197074_04.php.formatted
 
b/php/php.editor/test/unit/data/testfiles/formatting/broken/issue197074_04.php.formatted
index 49243bbd16..85edae3adc 100644
--- 
a/php/php.editor/test/unit/data/testfiles/formatting/broken/issue197074_04.php.formatted
+++ 
b/php/php.editor/test/unit/data/testfiles/formatting/broken/issue197074_04.php.formatted
@@ -72,10 +72,10 @@ if ($request->isMethod('post') && 
$form->bindAndValid($request)) {
 
 $module_action = $this->getPage()->getModuleAction();
 if ($module_action == 'main/editCompanyAddress')
-$
-this->redirect 
($this->getHelper()->link('main/editMyCompany')->getHref());
+$t
+his->redirect 
($this->getHelper()->link('main/editMyCompany')->getHref());
 
 }
-$this->forms['CompanyAddresses '] = $form;
+$this->forms['CompanyAddresses  '] = $form;
 
 }
diff --git 
a/php/php.editor/test/unit/data/testfiles/formatting/spaces/gh5380_01.php 
b/php/php.editor/test/unit/data/testfiles/formatting/spaces/gh5380_01.php
new file mode 100644
index 00..5961bc2eb3
--- /dev/null
+++ b/php/php.editor/test/unit/data/testfiles/formatting/spaces/gh5380_01.php
@@ -0,0 +1,23 @@
+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.
+ */
+
+var_dump(   $test   );
+var_dump( $test ? 1 : 2 );
+var_dump( $test ?? null );
diff --git 
a/php/php.editor/test/unit/data/testfiles/formatting/spaces/gh5380_01.php.testGH5380_01a.formatted
 
b/php/php.editor/test/unit/data/testfiles/formatting/spaces/gh5380_01.php.testGH5380_01a.formatted
new file mode 100644
index 00..4ec40c6bdb
--- /dev/null
+++