This is an automated email from the ASF dual-hosted git repository. chrizzly 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 cdd9b57 NETBEANS-1499 - Added suitable icon for package.json, package-lock.json and npm-debug.log cdd9b57 is described below commit cdd9b576f0ef5c27680aa64f6ed61b69b0553f94 Author: Chris2011 <christian.l...@gmx.net> AuthorDate: Fri Nov 23 16:39:22 2018 +0100 NETBEANS-1499 - Added suitable icon for package.json, package-lock.json and npm-debug.log - Removed unused layer.xml and the reference inside of manifest.mf. - Added npm logo used for the package.json file icon. - Added new DataObject for the package.json file to add a more specific icon instead of the js one. - Removed usage of the mimeresolver, will be handled now inside of the new PackageJsonDataObject. - Added requested comments into svg file, generated png and added license info. - Added new DataObjects for npm-debug.log and package-lock.json to add the npm logo to them. - Fixed missing source and history tab. - Fixed text/plain to text/npm-log for npm-debug.log file. --- webcommon/javascript.nodejs/licenseinfo.xml | 1 + webcommon/javascript.nodejs/manifest.mf | 1 - .../nodejs/file/NpmDebugLogDataObject.java | 100 +++++++++++++++++++++ .../javascript/nodejs/file/PackageJson.java | 2 - .../nodejs/file/PackageJsonDataObject.java | 100 +++++++++++++++++++++ .../nodejs/file/PackageLockJsonDataObject.java | 100 +++++++++++++++++++++ .../modules/javascript/nodejs/resources/layer.xml | 36 -------- .../javascript/nodejs/resources/npm-resolver.xml | 8 ++ .../modules/javascript/nodejs/ui/resources/npm.png | Bin 0 -> 1001 bytes .../modules/javascript/nodejs/ui/resources/npm.svg | 31 +++++++ 10 files changed, 340 insertions(+), 39 deletions(-) diff --git a/webcommon/javascript.nodejs/licenseinfo.xml b/webcommon/javascript.nodejs/licenseinfo.xml index b45fe2c..040f68d 100644 --- a/webcommon/javascript.nodejs/licenseinfo.xml +++ b/webcommon/javascript.nodejs/licenseinfo.xml @@ -45,6 +45,7 @@ <file>src/org/netbeans/modules/javascript/nodejs/ui/resources/nodejs-badge.png</file> <file>src/org/netbeans/modules/javascript/nodejs/ui/resources/unknown.png</file> <file>src/org/netbeans/modules/javascript/nodejs/ui/resources/uptodate.gif</file> + <file>src/org/netbeans/modules/javascript/nodejs/ui/resources/npm.png</file> <license ref="Apache-2.0-ASF" /> <comment type="COMMENT_UNSUPPORTED" /> </fileset> diff --git a/webcommon/javascript.nodejs/manifest.mf b/webcommon/javascript.nodejs/manifest.mf index 6f26af7..39617e2 100644 --- a/webcommon/javascript.nodejs/manifest.mf +++ b/webcommon/javascript.nodejs/manifest.mf @@ -1,6 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.javascript.nodejs/0 -OpenIDE-Module-Layer: org/netbeans/modules/javascript/nodejs/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javascript/nodejs/resources/Bundle.properties OpenIDE-Module-Specification-Version: 0.34 AutoUpdate-Show-In-Client: false diff --git a/webcommon/javascript.nodejs/src/org/netbeans/modules/javascript/nodejs/file/NpmDebugLogDataObject.java b/webcommon/javascript.nodejs/src/org/netbeans/modules/javascript/nodejs/file/NpmDebugLogDataObject.java new file mode 100644 index 0000000..09e9439 --- /dev/null +++ b/webcommon/javascript.nodejs/src/org/netbeans/modules/javascript/nodejs/file/NpmDebugLogDataObject.java @@ -0,0 +1,100 @@ +/* + * 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.javascript.nodejs.file; + +import java.io.IOException; +import org.openide.awt.ActionID; +import org.openide.awt.ActionReference; +import org.openide.awt.ActionReferences; +import org.openide.filesystems.FileObject; +import org.openide.filesystems.MIMEResolver; +import org.openide.loaders.DataObject.Registration; +import org.openide.loaders.DataObjectExistsException; +import org.openide.loaders.MultiDataObject; +import org.openide.loaders.MultiFileLoader; +import org.openide.util.NbBundle.Messages; + +@Messages({ + "LBL_NpmDebugLog_LOADER=npm-debug.log" +}) +@MIMEResolver.Registration(displayName = "npm-debug.log", resource = "../resources/npm-resolver.xml", position = 127) +@Registration(displayName = "#LBL_NpmDebugLog_LOADER", iconBase = "org/netbeans/modules/javascript/nodejs/ui/resources/npm.png", mimeType = "text/npm-log") +@ActionReferences({ + @ActionReference( + path = "Loaders/text/npm-log/Actions", + id = @ActionID(category = "System", id = "org.openide.actions.OpenAction"), + position = 100, + separatorAfter = 200 + ), + @ActionReference( + path = "Loaders/text/npm-log/Actions", + id = @ActionID(category = "Edit", id = "org.openide.actions.CutAction"), + position = 300 + ), + @ActionReference( + path = "Loaders/text/npm-log/Actions", + id = @ActionID(category = "Edit", id = "org.openide.actions.CopyAction"), + position = 400, + separatorAfter = 500 + ), + @ActionReference( + path = "Loaders/text/npm-log/Actions", + id = @ActionID(category = "Edit", id = "org.openide.actions.DeleteAction"), + position = 600 + ), + @ActionReference( + path = "Loaders/text/npm-log/Actions", + id = @ActionID(category = "System", id = "org.openide.actions.RenameAction"), + position = 700, + separatorAfter = 800 + ), + @ActionReference( + path = "Loaders/text/npm-log/Actions", + id = @ActionID(category = "System", id = "org.openide.actions.SaveAsTemplateAction"), + position = 900, + separatorAfter = 1000 + ), + @ActionReference( + path = "Loaders/text/npm-log/Actions", + id = @ActionID(category = "System", id = "org.openide.actions.FileSystemAction"), + position = 1100, + separatorAfter = 1200 + ), + @ActionReference( + path = "Loaders/text/npm-log/Actions", + id = @ActionID(category = "System", id = "org.openide.actions.ToolsAction"), + position = 1300 + ), + @ActionReference( + path = "Loaders/text/npm-log/Actions", + id = @ActionID(category = "System", id = "org.openide.actions.PropertiesAction"), + position = 1400 + ) +}) +public class NpmDebugLogDataObject extends MultiDataObject { + public NpmDebugLogDataObject(FileObject pf, MultiFileLoader loader) throws DataObjectExistsException, IOException { + super(pf, loader); + registerEditor("text/npm-log", true); + } + + @Override + protected int associateLookup() { + return 1; + } +} \ No newline at end of file diff --git a/webcommon/javascript.nodejs/src/org/netbeans/modules/javascript/nodejs/file/PackageJson.java b/webcommon/javascript.nodejs/src/org/netbeans/modules/javascript/nodejs/file/PackageJson.java index 3ee5973..e1ea258 100644 --- a/webcommon/javascript.nodejs/src/org/netbeans/modules/javascript/nodejs/file/PackageJson.java +++ b/webcommon/javascript.nodejs/src/org/netbeans/modules/javascript/nodejs/file/PackageJson.java @@ -29,12 +29,10 @@ import org.netbeans.api.annotations.common.CheckForNull; import org.netbeans.api.annotations.common.NullAllowed; import org.netbeans.modules.web.clientproject.api.json.JsonFile; import org.openide.filesystems.FileObject; -import org.openide.filesystems.MIMEResolver; /** * Class representing project's <tt>package.json</tt> file. */ -@MIMEResolver.Registration(displayName = "package.json", resource = "../resources/npm-resolver.xml", position = 127) public final class PackageJson { public static final String FILE_NAME = "package.json"; // NOI18N diff --git a/webcommon/javascript.nodejs/src/org/netbeans/modules/javascript/nodejs/file/PackageJsonDataObject.java b/webcommon/javascript.nodejs/src/org/netbeans/modules/javascript/nodejs/file/PackageJsonDataObject.java new file mode 100644 index 0000000..52d3519 --- /dev/null +++ b/webcommon/javascript.nodejs/src/org/netbeans/modules/javascript/nodejs/file/PackageJsonDataObject.java @@ -0,0 +1,100 @@ +/* + * 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.javascript.nodejs.file; + +import java.io.IOException; +import org.openide.awt.ActionID; +import org.openide.awt.ActionReference; +import org.openide.awt.ActionReferences; +import org.openide.filesystems.FileObject; +import org.openide.filesystems.MIMEResolver; +import org.openide.loaders.DataObject.Registration; +import org.openide.loaders.DataObjectExistsException; +import org.openide.loaders.MultiDataObject; +import org.openide.loaders.MultiFileLoader; +import org.openide.util.NbBundle.Messages; + +@Messages({ + "LBL_PackageJson_LOADER=package.json" +}) +@MIMEResolver.Registration(displayName = "package.json", resource = "../resources/npm-resolver.xml", position = 127) +@Registration(displayName = "#LBL_PackageJson_LOADER", iconBase = "org/netbeans/modules/javascript/nodejs/ui/resources/npm.png", mimeType = "text/package+x-json") +@ActionReferences({ + @ActionReference( + path = "Loaders/text/package+x-json/Actions", + id = @ActionID(category = "System", id = "org.openide.actions.OpenAction"), + position = 100, + separatorAfter = 200 + ), + @ActionReference( + path = "Loaders/text/package+x-json/Actions", + id = @ActionID(category = "Edit", id = "org.openide.actions.CutAction"), + position = 300 + ), + @ActionReference( + path = "Loaders/text/package+x-json/Actions", + id = @ActionID(category = "Edit", id = "org.openide.actions.CopyAction"), + position = 400, + separatorAfter = 500 + ), + @ActionReference( + path = "Loaders/text/package+x-json/Actions", + id = @ActionID(category = "Edit", id = "org.openide.actions.DeleteAction"), + position = 600 + ), + @ActionReference( + path = "Loaders/text/package+x-json/Actions", + id = @ActionID(category = "System", id = "org.openide.actions.RenameAction"), + position = 700, + separatorAfter = 800 + ), + @ActionReference( + path = "Loaders/text/package+x-json/Actions", + id = @ActionID(category = "System", id = "org.openide.actions.SaveAsTemplateAction"), + position = 900, + separatorAfter = 1000 + ), + @ActionReference( + path = "Loaders/text/package+x-json/Actions", + id = @ActionID(category = "System", id = "org.openide.actions.FileSystemAction"), + position = 1100, + separatorAfter = 1200 + ), + @ActionReference( + path = "Loaders/text/package+x-json/Actions", + id = @ActionID(category = "System", id = "org.openide.actions.ToolsAction"), + position = 1300 + ), + @ActionReference( + path = "Loaders/text/package+x-json/Actions", + id = @ActionID(category = "System", id = "org.openide.actions.PropertiesAction"), + position = 1400 + ) +}) +public class PackageJsonDataObject extends MultiDataObject { + public PackageJsonDataObject(FileObject pf, MultiFileLoader loader) throws DataObjectExistsException, IOException { + super(pf, loader); + registerEditor("text/package+x-json", true); + } + + @Override + protected int associateLookup() { + return 1; + } +} \ No newline at end of file diff --git a/webcommon/javascript.nodejs/src/org/netbeans/modules/javascript/nodejs/file/PackageLockJsonDataObject.java b/webcommon/javascript.nodejs/src/org/netbeans/modules/javascript/nodejs/file/PackageLockJsonDataObject.java new file mode 100644 index 0000000..f72361c --- /dev/null +++ b/webcommon/javascript.nodejs/src/org/netbeans/modules/javascript/nodejs/file/PackageLockJsonDataObject.java @@ -0,0 +1,100 @@ +/* + * 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.javascript.nodejs.file; + +import java.io.IOException; +import org.openide.awt.ActionID; +import org.openide.awt.ActionReference; +import org.openide.awt.ActionReferences; +import org.openide.filesystems.FileObject; +import org.openide.filesystems.MIMEResolver; +import org.openide.loaders.DataObject.Registration; +import org.openide.loaders.DataObjectExistsException; +import org.openide.loaders.MultiDataObject; +import org.openide.loaders.MultiFileLoader; +import org.openide.util.NbBundle.Messages; + +@Messages({ + "LBL_PackageLockJson_LOADER=package-lock.json" +}) +@MIMEResolver.Registration(displayName = "package-lock.json", resource = "../resources/npm-resolver.xml", position = 127) +@Registration(displayName = "#LBL_PackageLockJson_LOADER", iconBase = "org/netbeans/modules/javascript/nodejs/ui/resources/npm.png", mimeType = "text/package-lock+x-json") +@ActionReferences({ + @ActionReference( + path = "Loaders/text/package-lock+x-json/Actions", + id = @ActionID(category = "System", id = "org.openide.actions.OpenAction"), + position = 100, + separatorAfter = 200 + ), + @ActionReference( + path = "Loaders/text/package-lock+x-json/Actions", + id = @ActionID(category = "Edit", id = "org.openide.actions.CutAction"), + position = 300 + ), + @ActionReference( + path = "Loaders/text/package-lock+x-json/Actions", + id = @ActionID(category = "Edit", id = "org.openide.actions.CopyAction"), + position = 400, + separatorAfter = 500 + ), + @ActionReference( + path = "Loaders/text/package-lock+x-json/Actions", + id = @ActionID(category = "Edit", id = "org.openide.actions.DeleteAction"), + position = 600 + ), + @ActionReference( + path = "Loaders/text/package-lock+x-json/Actions", + id = @ActionID(category = "System", id = "org.openide.actions.RenameAction"), + position = 700, + separatorAfter = 800 + ), + @ActionReference( + path = "Loaders/text/package-lock+x-json/Actions", + id = @ActionID(category = "System", id = "org.openide.actions.SaveAsTemplateAction"), + position = 900, + separatorAfter = 1000 + ), + @ActionReference( + path = "Loaders/text/package-lock+x-json/Actions", + id = @ActionID(category = "System", id = "org.openide.actions.FileSystemAction"), + position = 1100, + separatorAfter = 1200 + ), + @ActionReference( + path = "Loaders/text/package-lock+x-json/Actions", + id = @ActionID(category = "System", id = "org.openide.actions.ToolsAction"), + position = 1300 + ), + @ActionReference( + path = "Loaders/text/package-lock+x-json/Actions", + id = @ActionID(category = "System", id = "org.openide.actions.PropertiesAction"), + position = 1400 + ) +}) +public class PackageLockJsonDataObject extends MultiDataObject { + public PackageLockJsonDataObject(FileObject pf, MultiFileLoader loader) throws DataObjectExistsException, IOException { + super(pf, loader); + registerEditor("text/package-lock+x-json", true); + } + + @Override + protected int associateLookup() { + return 1; + } +} \ No newline at end of file diff --git a/webcommon/javascript.nodejs/src/org/netbeans/modules/javascript/nodejs/resources/layer.xml b/webcommon/javascript.nodejs/src/org/netbeans/modules/javascript/nodejs/resources/layer.xml deleted file mode 100644 index 70b98ec..0000000 --- a/webcommon/javascript.nodejs/src/org/netbeans/modules/javascript/nodejs/resources/layer.xml +++ /dev/null @@ -1,36 +0,0 @@ -<?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. - ---> - -<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.2//EN" "http://www.netbeans.org/dtds/filesystem-1_2.dtd"> -<filesystem> - - <folder name="Loaders"> - <folder name="text"> - <folder name="package+x-json"> - <folder name="Factories"> - <file name="org-netbeans-modules-csl-core-GsfDataLoader.instance"/> - </folder> - </folder> - </folder> - </folder> - -</filesystem> diff --git a/webcommon/javascript.nodejs/src/org/netbeans/modules/javascript/nodejs/resources/npm-resolver.xml b/webcommon/javascript.nodejs/src/org/netbeans/modules/javascript/nodejs/resources/npm-resolver.xml index 4e175b0..c74d027 100644 --- a/webcommon/javascript.nodejs/src/org/netbeans/modules/javascript/nodejs/resources/npm-resolver.xml +++ b/webcommon/javascript.nodejs/src/org/netbeans/modules/javascript/nodejs/resources/npm-resolver.xml @@ -26,4 +26,12 @@ <name name="package.json"/> <resolver mime="text/package+x-json"/> </file> + <file> + <name name="package-lock.json"/> + <resolver mime="text/package-lock+x-json"/> + </file> + <file> + <name name="npm-debug.log"/> + <resolver mime="text/npm-log"/> + </file> </MIME-resolver> diff --git a/webcommon/javascript.nodejs/src/org/netbeans/modules/javascript/nodejs/ui/resources/npm.png b/webcommon/javascript.nodejs/src/org/netbeans/modules/javascript/nodejs/ui/resources/npm.png new file mode 100644 index 0000000..dd462c2 Binary files /dev/null and b/webcommon/javascript.nodejs/src/org/netbeans/modules/javascript/nodejs/ui/resources/npm.png differ diff --git a/webcommon/javascript.nodejs/src/org/netbeans/modules/javascript/nodejs/ui/resources/npm.svg b/webcommon/javascript.nodejs/src/org/netbeans/modules/javascript/nodejs/ui/resources/npm.svg new file mode 100644 index 0000000..b350d68 --- /dev/null +++ b/webcommon/javascript.nodejs/src/org/netbeans/modules/javascript/nodejs/ui/resources/npm.svg @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- + + 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. + +--> + +<!-- +- File was acquired from https://raw.githubusercontent.com/simple-icons/simple-icons/develop/icons/npm.svg +- According to the project license file, the icons are licensed CC-0: https://github.com/simple-icons/simple-icons/blob/develop/LICENSE.md +- the file was formatted, an XML declaration, the ALv2 header and the +- description of the changes was added +- the file was opened, color was modified to #CC3534 and saved with NetBeans +- color was taken from here: https://www.schemecolor.com/npm-logo-colors.php +--> +<svg role="img" viewBox="0 0 24 24" fill="#CC3534" xmlns="http://www.w3.org/2000/svg"><title>NPM icon</title><path d="M0 7.334v8h6.666v1.332H12v-1.332h12v-8H0zm6.666 6.664H5.334v-4H3.999v4H1.335V8.667h5.331v5.331zm4 0v1.336H8.001V8.667h5.334v5.332h-2.669v-.001zm12.001 0h-1.33v-4h-1.336v4h-1.335v-4h-1.33v4h-2.671V8.667h8.002v5.331zM10.665 10H12v2.667h-1.335V10z"/></svg> \ No newline at end of file --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists