sdedic commented on code in PR #7649:
URL: https://github.com/apache/netbeans/pull/7649#discussion_r1711039548
##########
java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/LspAssetsDecorationProvider.java:
##########
@@ -101,6 +103,11 @@ public TreeItemData createDecorations(Node n, boolean
expanded) {
d.addContextValues(CTXVALUE_CAP_REFERENCE_NAME);
set = true;
}
+
+ if (item instanceof SecretItem) {
Review Comment:
@jhorvath these interface-dependent extractions ("if X in Lookup, use put
"prefix:${X.property}" into contextValue) seem rather common / useful ... if
the usage will grow, we could invent a declarative support for that, would be
then far easier to export state to LSP clients.
##########
enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/DeleteNodeAction.java:
##########
@@ -0,0 +1,110 @@
+/*
+ * 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.cloud.oracle.actions;
+
+import java.awt.event.ActionEvent;
+import java.io.IOException;
+import java.util.Collection;
+import javax.swing.AbstractAction;
+import javax.swing.Action;
+import org.openide.DialogDisplayer;
+import org.openide.NotifyDescriptor;
+import org.openide.awt.ActionID;
+import org.openide.awt.ActionReference;
+import org.openide.awt.ActionReferences;
+import org.openide.awt.ActionRegistration;
+import org.openide.nodes.Node;
+import org.openide.util.ContextAwareAction;
+import org.openide.util.Exceptions;
+import org.openide.util.Lookup;
+import org.openide.util.NbBundle;
+import org.openide.util.RequestProcessor;
+
+/**
+ *
+ * @author Dusan Petrovic
+ */
+@ActionID(
+ category = "Tools",
+ id = "org.netbeans.modules.cloud.oracle.actions.DeleteNodeAction"
+)
+@ActionRegistration(
+ displayName = "#DeleteNodeAction",
+ asynchronous = true,
+ lazy = true
+)
+
+@ActionReferences(value = {
+ @ActionReference(path = "Cloud/Oracle/ContainerTag/Actions", position =
250),
+ @ActionReference(path = "Cloud/Oracle/Vault/Secret/Actions", position =
250)
+})
[email protected]({
+ "DeleteNodeAction=Delete item",
+ "MSG_ConfirmDeleteAction=Are you sure that you want to delete {0}",
Review Comment:
Nobody funds (much) internationalization ;) these days ... but still:
please place a comment line above parametrized message. The recommended format
is
```
# {n} - description of parameter n
```
It used to help translators to understand what individual parameters
represent; they work primarily with .properties only.
##########
enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/vault/SecretNode.java:
##########
@@ -41,13 +56,81 @@ public SecretNode(SecretItem vault) {
setName(vault.getName());
setDisplayName(vault.getName());
setIconBaseWithExtension(SECRET_ICON);
- setShortDescription(vault.getDescription());
+ setShortDescription(
+ createShortDescription(
+ vault.getLifecycleState(),
+ vault.getDeletionTime()));
+ }
+
+ private String createShortDescription(String state, Date deletionTime) {
+ if (deletionTime != null) {
+ return Bundle.SecretNodeDesc(this.getItem().getName(), state,
getDeletionTimeInfo(deletionTime));
+ }
+ return Bundle.SecretNodeDesc(this.getItem().getName(), state, "");
+ }
+
+ private String getDeletionTimeInfo(Date deletionTime) {
+ SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd
HH:mm:ss");
+ return "\nDeletion time: " + dateFormat.format(deletionTime);
}
public static NodeProvider<SecretItem> createNode() {
return SecretNode::new;
}
+
+ @Override
+ public void update(OCIItem item) {
Review Comment:
Make sure `update` does not run in a LSP messaging thread, or other 'must
not block' thread ...
--
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