This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 202766
Collapse All | Expand All

(-)a/tomcat5/nbproject/project.xml (+9 lines)
Lines 92-97 Link Here
92
                    </run-dependency>
92
                    </run-dependency>
93
                </dependency>
93
                </dependency>
94
                <dependency>
94
                <dependency>
95
                    <code-name-base>org.netbeans.core.multiview</code-name-base>
96
                    <build-prerequisite/>
97
                    <compile-dependency/>
98
                    <run-dependency>
99
                        <release-version>1</release-version>
100
                        <specification-version>1.26</specification-version>
101
                    </run-dependency>
102
                </dependency>
103
                <dependency>
95
                    <code-name-base>org.netbeans.libs.xerces</code-name-base>
104
                    <code-name-base>org.netbeans.libs.xerces</code-name-base>
96
                    <build-prerequisite/>
105
                    <build-prerequisite/>
97
                    <compile-dependency/>
106
                    <compile-dependency/>
(-)a/tomcat5/src/org/netbeans/modules/tomcat5/nodes/Bundle.properties (+1 lines)
Lines 50-52 Link Here
50
MSG_AuthorizationFailed=Access to Tomcat server has not been authorized. Set the \
50
MSG_AuthorizationFailed=Access to Tomcat server has not been authorized. Set the \
51
correct username and password with the \"{0}\" role in the Tomcat customizer \
51
correct username and password with the \"{0}\" role in the Tomcat customizer \
52
in the Server Manager.
52
in the Server Manager.
53
CTL_SourceTabCaption=Source
(-)a/tomcat5/src/org/netbeans/modules/tomcat5/nodes/TomcatInstanceNode.java (+22 lines)
Lines 48-53 Link Here
48
import java.util.LinkedList;
48
import java.util.LinkedList;
49
import java.util.logging.Level;
49
import java.util.logging.Level;
50
import java.util.logging.Logger;
50
import java.util.logging.Logger;
51
import org.netbeans.core.spi.multiview.MultiViewElement;
52
import org.netbeans.core.spi.multiview.text.MultiViewEditorElement;
51
import org.netbeans.modules.tomcat5.TomcatManager;
53
import org.netbeans.modules.tomcat5.TomcatManager;
52
import org.netbeans.modules.tomcat5.nodes.actions.AdminConsoleAction;
54
import org.netbeans.modules.tomcat5.nodes.actions.AdminConsoleAction;
53
import org.netbeans.modules.tomcat5.nodes.actions.ServerLogAction;
55
import org.netbeans.modules.tomcat5.nodes.actions.ServerLogAction;
Lines 69-74 Link Here
69
import org.openide.nodes.AbstractNode;
71
import org.openide.nodes.AbstractNode;
70
import org.openide.nodes.Children;
72
import org.openide.nodes.Children;
71
import org.openide.nodes.Node;
73
import org.openide.nodes.Node;
74
import org.openide.windows.TopComponent;
72
75
73
76
74
/**
77
/**
Lines 177-180 Link Here
177
    public boolean hasServerLog() {
180
    public boolean hasServerLog() {
178
        return tm.logManager().hasServerLog();
181
        return tm.logManager().hasServerLog();
179
    }
182
    }
183
    
184
    /**
185
     * Overrides the compatible XML DO behaviour for files without data objects
186
     * @param context
187
     * @return 
188
     */
189
    @MultiViewElement.Registration(
190
        displayName="org.netbeans.modules.tomcat5.nodes.Bundle#CTL_SourceTabCaption",
191
        iconBase="org/netbeans/modules/tomcat5/resources/tomcat5.gif",
192
        persistenceType=TopComponent.PERSISTENCE_ONLY_OPENED,
193
        preferredID="xml.text",
194
        mimeType="text/tomcat5+xml",
195
        position=1
196
    )
197
    public static MultiViewEditorElement createMultiViewEditorElement(Lookup context) {
198
        return new MultiViewEditorElement(context);
199
    }
200
        
201
180
}
202
}
(-)a/xml/nbproject/project.xml (+9 lines)
Lines 77-82 Link Here
77
                    </run-dependency>
77
                    </run-dependency>
78
                </dependency>
78
                </dependency>
79
                <dependency>
79
                <dependency>
80
                    <code-name-base>org.netbeans.modules.editor.mimelookup</code-name-base>
81
                    <build-prerequisite/>
82
                    <compile-dependency/>
83
                    <run-dependency>
84
                        <release-version>1</release-version>
85
                        <specification-version>1.24</specification-version>
86
                    </run-dependency>
87
                </dependency>
88
                <dependency>
80
                    <code-name-base>org.netbeans.modules.projectapi</code-name-base>
89
                    <code-name-base>org.netbeans.modules.projectapi</code-name-base>
81
                    <build-prerequisite/>
90
                    <build-prerequisite/>
82
                    <compile-dependency/>
91
                    <compile-dependency/>
(-)a/xml/src/org/netbeans/modules/xml/text/TextEditorSupport.java (-2 / +28 lines)
Lines 45-60 Link Here
45
45
46
import org.netbeans.modules.xml.util.Util;
46
import org.netbeans.modules.xml.util.Util;
47
import java.io.*;
47
import java.io.*;
48
import java.text.*;
49
import java.util.Enumeration;
48
import java.util.Enumeration;
50
import java.lang.ref.WeakReference;
49
import java.lang.ref.WeakReference;
51
import java.beans.PropertyChangeEvent;
50
import java.beans.PropertyChangeEvent;
52
51
52
import java.util.Collection;
53
import javax.swing.Timer;
53
import javax.swing.Timer;
54
import javax.swing.event.*;
54
import javax.swing.event.*;
55
import javax.swing.text.*;
55
import javax.swing.text.*;
56
56
57
import org.netbeans.api.editor.mimelookup.MimeLookup;
57
import org.netbeans.core.api.multiview.MultiViews;
58
import org.netbeans.core.api.multiview.MultiViews;
59
import org.netbeans.core.spi.multiview.MultiViewDescription;
58
import org.netbeans.modules.xml.api.EncodingUtil;
60
import org.netbeans.modules.xml.api.EncodingUtil;
59
import org.openide.*;
61
import org.openide.*;
60
import org.openide.awt.StatusDisplayer;
62
import org.openide.awt.StatusDisplayer;
Lines 69-75 Link Here
69
import org.openide.filesystems.FileLock;
71
import org.openide.filesystems.FileLock;
70
72
71
import org.netbeans.modules.xml.*;
73
import org.netbeans.modules.xml.*;
72
import org.netbeans.modules.xml.lib.*;
74
import org.netbeans.modules.xml.XMLDataObject;
73
import org.netbeans.modules.xml.sync.*;
75
import org.netbeans.modules.xml.sync.*;
74
import org.netbeans.modules.xml.cookies.*;
76
import org.netbeans.modules.xml.cookies.*;
75
import org.netbeans.modules.xml.text.syntax.XMLKit;
77
import org.netbeans.modules.xml.text.syntax.XMLKit;
Lines 154-163 Link Here
154
156
155
    @Override
157
    @Override
156
    protected Pane createPane() {
158
    protected Pane createPane() {
159
        // defect #202766: whatever+xml gets multiview, although there is nobody
160
        // who would register the editor. M
161
        if (getDataObject().getClass() == XMLDataObject.class &&
162
            !mimeType.equals(XMLDataObject.MIME_PLAIN_XML) &&
163
            !hasMultiTextEditor()) {
164
            return super.createCloneableEditor();
165
        }
157
        return (CloneableEditorSupport.Pane)MultiViews.createCloneableMultiView(mimeType, 
166
        return (CloneableEditorSupport.Pane)MultiViews.createCloneableMultiView(mimeType, 
158
                getDataObject());
167
                getDataObject());
159
    }
168
    }
160
    
169
    
170
    /**
171
     * Detects whether XML source editor is registered: must start with 'xml.text'. If
172
     * a module registers such multiview, it's responsible for displaying source in this
173
     * pane.
174
     * 
175
     * @return true, if multiview source editor is available and multiview pane should be created
176
     */
177
    boolean hasMultiTextEditor() {
178
        Collection<? extends MultiViewDescription> all = MimeLookup.getLookup(mimeType).lookupAll(MultiViewDescription.class);
179
        for (MultiViewDescription d : all) {
180
            if (d.preferredID().startsWith("xml.text")) {
181
                return true;
182
            }
183
        }
184
        return false;
185
    }
186
    
161
    /*
187
    /*
162
     * Add listeners at Document and document memory status (loading).
188
     * Add listeners at Document and document memory status (loading).
163
     */
189
     */

Return to bug 202766