Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@
import org.netbeans.core.spi.multiview.MultiViewDescription;
import org.netbeans.core.spi.multiview.MultiViewElement;
import org.netbeans.core.spi.multiview.MultiViewElementCallback;
import static org.netbeans.modules.maven.grammar.Bundle.*;
import org.netbeans.modules.maven.indexer.api.NBVersionInfo;
import org.netbeans.modules.maven.indexer.api.RepositoryUtil;
import org.netbeans.modules.maven.indexer.spi.ui.ArtifactViewerPanelProvider;
import org.openide.awt.Actions;
import org.openide.awt.UndoRedo;
import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileUtil;
import org.openide.text.CloneableEditorSupport;
import org.openide.util.HelpCtx;
import org.openide.util.ImageUtilities;
import org.openide.util.Lookup;
Expand All @@ -59,6 +59,8 @@
import org.openide.util.lookup.ServiceProvider;
import org.openide.windows.TopComponent;

import static org.netbeans.modules.maven.grammar.Bundle.*;

public class BasicPomMD implements MultiViewDescription, Serializable {

private static final RequestProcessor RP = new RequestProcessor(BasicPomMD.class);
Expand Down Expand Up @@ -202,23 +204,21 @@ private static class POMView implements MultiViewElement, Runnable {
throw new FileNotFoundException(pom.getAbsolutePath());
}
final String text = FileEncodingQuery.getEncoding(pomFO).decode(ByteBuffer.wrap(pomFO.asBytes())).toString();
EventQueue.invokeLater(new Runnable() {
@Override public void run() {
JEditorPane pane = new JEditorPane("text/xml", text);
pane.setEditable(false);
pane.setCaretPosition(0);
panel.removeAll();
panel.add(new JScrollPane(pane), BorderLayout.CENTER);
panel.revalidate();
}
EventQueue.invokeLater(() -> {
JEditorPane pane = new JEditorPane();
pane.setEditorKit(CloneableEditorSupport.getEditorKit("text/xml"));
pane.setText(text);
pane.setEditable(false);
pane.setCaretPosition(0);
panel.removeAll();
panel.add(new JScrollPane(pane), BorderLayout.CENTER);
panel.revalidate();
});
} catch (final Exception x) {
EventQueue.invokeLater(new Runnable() {
@Override public void run() {
panel.removeAll();
panel.add(new JLabel(LBL_failed_to_load(x.getLocalizedMessage()), SwingConstants.CENTER), BorderLayout.CENTER);
panel.revalidate();
}
EventQueue.invokeLater(() -> {
panel.removeAll();
panel.add(new JLabel(LBL_failed_to_load(x.getLocalizedMessage()), SwingConstants.CENTER), BorderLayout.CENTER);
panel.revalidate();
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.netbeans.modules.maven.spi.customizer.TextToValueConversions;
import org.netbeans.spi.project.ProjectConfiguration;
import org.netbeans.spi.project.ProjectConfigurationProvider;
import org.openide.text.CloneableEditorSupport;

/**
*
Expand All @@ -56,7 +57,7 @@ public Component getListCellRendererComponent(JList list, Object value, int inde
});
comConfiguration.setSelectedItem(configs.getActiveConfiguration());
enableFields();
epProperties.setContentType("text/x-properties");
epProperties.setEditorKit(CloneableEditorSupport.getEditorKit("text/x-properties"));
}

MavenConfiguration getSelectedConfig() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@
<SubComponents>
<Component class="javax.swing.JEditorPane" name="epProperties">
<Properties>
<Property name="contentType" type="java.lang.String" value="text/x-properties" noResource="true"/>
<Property name="editorKit" type="javax.swing.text.EditorKit" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="CloneableEditorSupport.getEditorKit(&quot;text/x-properties&quot;)" type="code"/>
</Property>
</Properties>
</Component>
</SubComponents>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import org.openide.DialogDescriptor;
import org.openide.text.CloneableEditorSupport;

/**
*
Expand Down Expand Up @@ -137,7 +138,7 @@ private void initComponents() {
lblProperties.setLabelFor(epProperties);
org.openide.awt.Mnemonics.setLocalizedText(lblProperties, org.openide.util.NbBundle.getMessage(NewConfigurationPanel.class, "NewConfigurationPanel.lblProperties.text")); // NOI18N

epProperties.setContentType("text/x-properties"); // NOI18N
epProperties.setEditorKit(CloneableEditorSupport.getEditorKit("text/x-properties"));
jScrollPane1.setViewportView(epProperties);

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,9 @@
<SubComponents>
<Component class="javax.swing.JEditorPane" name="epProperties">
<Properties>
<Property name="contentType" type="java.lang.String" value="text/x-properties" noResource="true"/>
<Property name="editorKit" type="javax.swing.text.EditorKit" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="CloneableEditorSupport.getEditorKit(&quot;text/x-properties&quot;)" type="code"/>
</Property>
</Properties>
</Component>
</SubComponents>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
import org.openide.awt.Mnemonics;
import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileUtil;
import org.openide.text.CloneableEditorSupport;
import org.openide.util.Exceptions;
import org.openide.util.HelpCtx;
import org.openide.util.ImageUtilities;
Expand Down Expand Up @@ -508,7 +509,7 @@ private void initComponents() {
add(cbBuildWithDeps, gridBagConstraints);
cbBuildWithDeps.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ActionMappings.class, "ActionMappings.cbBuildWithDeps.AccessibleContext.accessibleDescription")); // NOI18N

epProperties.setContentType("text/x-properties"); // NOI18N
epProperties.setEditorKit(CloneableEditorSupport.getEditorKit("text/x-properties"));
jScrollPane5.setViewportView(epProperties);

gridBagConstraints = new java.awt.GridBagConstraints();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,9 @@
<SubComponents>
<Component class="javax.swing.JEditorPane" name="epProperties">
<Properties>
<Property name="contentType" type="java.lang.String" value="text/x-properties" noResource="true"/>
<Property name="editorKit" type="javax.swing.text.EditorKit" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="CloneableEditorSupport.getEditorKit(&quot;text/x-properties&quot;)" type="code"/>
</Property>
</Properties>
</Component>
</SubComponents>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import org.netbeans.modules.maven.execute.model.ActionToGoalMapping;
import org.netbeans.modules.maven.execute.model.NetbeansActionMapping;
import org.netbeans.modules.maven.spi.grammar.GoalsProvider;
import org.openide.text.CloneableEditorSupport;
import org.openide.util.ImageUtilities;
import org.openide.util.Lookup;
import org.openide.util.RequestProcessor;
Expand Down Expand Up @@ -288,7 +289,7 @@ private void initComponents() {
org.openide.awt.Mnemonics.setLocalizedText(btnAddProps, "&Add >");
btnAddProps.addActionListener(this::btnAddPropsActionPerformed);

epProperties.setContentType("text/x-properties"); // NOI18N
epProperties.setEditorKit(CloneableEditorSupport.getEditorKit("text/x-properties"));
jScrollPane2.setViewportView(epProperties);

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
Expand Down
Loading