forked from apache/netbeans
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NETBEANS-5599] PHP 8.1 Support: Enumerations (Part 10)
- https://issues.apache.org/jira/browse/NETBEANS-5599 - https://wiki.php.net/rfc/enumerations - Add the template for enum - Add `PhpEnum` as `PhpType`
- Loading branch information
Showing
10 changed files
with
190 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Manifest-Version: 1.0 | ||
OpenIDE-Module: org.netbeans.modules.php.api.editor/0 | ||
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/php/api/editor/resources/Bundle.properties | ||
OpenIDE-Module-Specification-Version: 0.42 | ||
OpenIDE-Module-Specification-Version: 0.43 |
94 changes: 94 additions & 0 deletions
94
php/php.api.editor/src/org/netbeans/modules/php/api/editor/PhpEnum.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
/* | ||
* 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. | ||
*/ | ||
package org.netbeans.modules.php.api.editor; | ||
|
||
import org.netbeans.api.annotations.common.NonNull; | ||
import org.netbeans.api.annotations.common.NullAllowed; | ||
import org.openide.filesystems.FileObject; | ||
|
||
/** | ||
* Class representing a PHP enum. | ||
*/ | ||
public class PhpEnum extends PhpType { | ||
|
||
public PhpEnum(String name, String fullyQualifiedName, String description) { | ||
super(name, fullyQualifiedName, description); | ||
} | ||
|
||
public PhpEnum(String name, String fullyQualifiedName) { | ||
super(name, fullyQualifiedName); | ||
} | ||
|
||
public PhpEnum(String name, String fullyQualifiedName, int offset) { | ||
super(name, fullyQualifiedName, offset); | ||
} | ||
|
||
public PhpEnum(String name, String fullyQualifiedName, int offset, String description) { | ||
super(name, fullyQualifiedName, offset, description); | ||
} | ||
|
||
@Override | ||
public PhpEnum addField(@NonNull String name, @NullAllowed String fullyQualifiedName, int offset, @NullAllowed String description) { | ||
super.addField(name, fullyQualifiedName, offset, description); | ||
return this; | ||
} | ||
|
||
@Override | ||
public PhpEnum addField(@NonNull String name, @NullAllowed String fullyQualifiedName, int offset) { | ||
return addField(name, fullyQualifiedName, offset, null); | ||
} | ||
|
||
@Override | ||
public PhpEnum addField(@NonNull String name, @NullAllowed String fullyQualifiedName) { | ||
return addField(name, fullyQualifiedName, -1, null); | ||
} | ||
|
||
@Override | ||
public PhpEnum addField(@NonNull String name, @NullAllowed String fullyQualifiedName, @NullAllowed String description) { | ||
return addField(name, fullyQualifiedName, -1, description); | ||
} | ||
|
||
@Override | ||
public PhpEnum addField(@NonNull String name, @NullAllowed PhpType type, @NullAllowed FileObject file, int offset) { | ||
super.addField(name, type, file, offset); | ||
return this; | ||
} | ||
|
||
@Override | ||
public PhpEnum addMethod(@NonNull String name, @NullAllowed String fullyQualifiedName, int offset, @NullAllowed String description) { | ||
super.addMethod(name, fullyQualifiedName, offset, description); | ||
return this; | ||
} | ||
|
||
@Override | ||
public PhpEnum addMethod(@NonNull String name, @NullAllowed String fullyQualifiedName, int offset) { | ||
return addMethod(name, fullyQualifiedName, offset, null); | ||
} | ||
|
||
@Override | ||
public PhpEnum addMethod(@NonNull String name, @NullAllowed String fullyQualifiedName) { | ||
return addMethod(name, fullyQualifiedName, -1, null); | ||
} | ||
|
||
@Override | ||
public PhpEnum addMethod(@NonNull String name, @NullAllowed String fullyQualifiedName, @NullAllowed String description) { | ||
return addMethod(name, fullyQualifiedName, -1, description); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Manifest-Version: 1.0 | ||
AutoUpdate-Show-In-Client: false | ||
OpenIDE-Module-Specification-Version: 2.156 | ||
OpenIDE-Module-Specification-Version: 2.157 | ||
OpenIDE-Module: org.netbeans.modules.php.project | ||
OpenIDE-Module-Layer: org/netbeans/modules/php/project/resources/layer.xml | ||
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/php/project/resources/Bundle.properties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
php/php.project/src/org/netbeans/modules/php/project/ui/resources/emptyEnumPHP.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<#-- | ||
|
||
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. | ||
|
||
--> | ||
<?php | ||
<#assign licenseFirst = "/* "> | ||
<#assign licensePrefix = " * "> | ||
<#assign licenseLast = " */"> | ||
<#include "${project.licensePath}"> | ||
|
||
<#if namespace?? && namespace?length > 0> | ||
namespace ${namespace}; | ||
</#if> | ||
|
||
/** | ||
* | ||
* @author ${user} | ||
*/ | ||
enum ${name} { | ||
//put your code here | ||
} |
31 changes: 31 additions & 0 deletions
31
...hp.project/src/org/netbeans/modules/php/project/ui/resources/emptyPHPEnumDescription.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<!-- | ||
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. | ||
--> | ||
|
||
<html> | ||
<head> | ||
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | ||
</head> | ||
<body> | ||
Creates empty PHP Enum. You can edit the file in the IDE's Source Editor. | ||
To change this template, choose Tools | Template Manager | ||
and open the template in the editor. | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters