mbien commented on code in PR #9736: URL: https://github.com/apache/netbeans/pull/9736#discussion_r4399208226
########## ide/generic.project/src/org/netbeans/modules/generic/project/ui/actions/GpOpenAsProjectAction.java: ########## @@ -0,0 +1,152 @@ +/* + * 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.generic.project.ui.actions; + +import java.awt.event.ActionEvent; +import java.io.File; +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.swing.AbstractAction; +import javax.swing.Action; +import org.netbeans.api.project.Project; +import org.netbeans.api.project.ProjectManager; +import org.netbeans.api.project.ui.OpenProjects; +import org.netbeans.modules.generic.project.ui.wizard.GpWizardIterator; +import org.netbeans.spi.project.ui.support.ProjectChooser; +import org.openide.awt.ActionID; +import org.openide.awt.ActionReference; +import org.openide.awt.ActionRegistration; +import org.openide.awt.DynamicMenuContent; +import org.openide.filesystems.FileObject; +import org.openide.filesystems.FileUtil; +import org.openide.loaders.DataFolder; +import org.openide.util.ContextAwareAction; +import org.openide.util.Lookup; +import org.openide.util.NbBundle.Messages; +import org.openide.util.RequestProcessor; +import static org.netbeans.modules.generic.project.ui.actions.Bundle.*; + +/** + * Context action for folder nodes: turns a folder which is not a project + * yet into a <em>local</em> generic project — recognition by the FileObject + * attribute only, no marker file in the working tree — and opens it in the + * Projects tab. + * <p> + * Registered on {@code Loaders/folder/any/Actions}, hence available on any + * folder node (e.g. in the Favorites tab or beneath an open project). + * Mirrors the inverse action {@code OpenProjectFolderAction} of the + * projectui module. + * + * @author mbien + */ +@Messages("GpOpenAsProjectAction.LBL_action=Open as Generic Project") +@ActionID(category = "Project", id = "org.netbeans.modules.generic.project.ui.actions.GpOpenAsProjectAction") +@ActionRegistration(displayName = "#GpOpenAsProjectAction.LBL_action", lazy = false) +@ActionReference(path = "Loaders/folder/any/Actions", position = 110) +public final class GpOpenAsProjectAction extends AbstractAction implements ContextAwareAction { Review Comment: just want to point out again that the only reason I added the action to this PR is for testing purposes -> it was meant to come with or after the API PR. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
