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 229019
Collapse All | Expand All

(-)a/lib.uihandler/manifest.mf (-1 / +1 lines)
Lines 2-6 Link Here
2
OpenIDE-Module: org.netbeans.lib.uihandler
2
OpenIDE-Module: org.netbeans.lib.uihandler
3
_OpenIDE-Module-Layer: org/netbeans/lib/uihandler/layer.xml
3
_OpenIDE-Module-Layer: org/netbeans/lib/uihandler/layer.xml
4
OpenIDE-Module-Localizing-Bundle: org/netbeans/lib/uihandler/Bundle.properties
4
OpenIDE-Module-Localizing-Bundle: org/netbeans/lib/uihandler/Bundle.properties
5
OpenIDE-Module-Specification-Version: 1.36
5
OpenIDE-Module-Specification-Version: 1.37
6
6
(-)a/lib.uihandler/nbproject/project.xml (-4 / +2 lines)
Lines 36-46 Link Here
36
                    </test-dependency>
36
                    </test-dependency>
37
                </test-type>
37
                </test-type>
38
            </test-dependencies>
38
            </test-dependencies>
39
            <friend-packages>
39
            <public-packages>
40
                <friend>org.netbeans.modules.uihandler</friend>
41
                <friend>org.netbeans.modules.bugzilla.exceptionreporter</friend>
42
                <package>org.netbeans.lib.uihandler</package>
40
                <package>org.netbeans.lib.uihandler</package>
43
            </friend-packages>
41
            </public-packages>
44
        </data>
42
        </data>
45
    </configuration>
43
    </configuration>
46
</project>
44
</project>
(-)a/lib.uihandler/src/org/netbeans/lib/uihandler/Decorable.java (-2 / +19 lines)
Lines 34-49 Link Here
34
34
35
/** A callback interface of a decorated representation of LogRecord.
35
/** A callback interface of a decorated representation of LogRecord.
36
 * Should be passed into {@link LogRecords#decorate} and will receive
36
 * Should be passed into {@link LogRecords#decorate} and will receive
37
 * appropriate callbacks.
37
 * appropriate call-backs.
38
 *
38
 *
39
 * @since 1.13
39
 * @since 1.13
40
 */
40
 */
41
public interface Decorable {
41
public interface Decorable {
42
    
43
    /**
44
     * Set the name.
45
     * @param n the name of the log record
46
     */
42
    public void setName(String n);
47
    public void setName(String n);
43
48
49
    /**
50
     * Set the display name.
51
     * @param n the display name of the log record
52
     */
44
    public void setDisplayName(String n);
53
    public void setDisplayName(String n);
45
54
55
    /**
56
     * Set the icon base.
57
     * @param base the icon base, including the extension, of the log record
58
     */
46
    public void setIconBaseWithExtension(String base);
59
    public void setIconBaseWithExtension(String base);
47
60
48
    public void setShortDescription(String format);
61
    /**
62
     * Set the short description.
63
     * @param shortDescription the short description of the log record
64
     */
65
    public void setShortDescription(String shortDescription);
49
}
66
}
(-)a/lib.uihandler/src/org/netbeans/lib/uihandler/Decorations.java (-2 / +2 lines)
Lines 43-53 Link Here
43
 *
43
 *
44
 * @author Jaroslav Tulach
44
 * @author Jaroslav Tulach
45
 */
45
 */
46
public final class Decorations {
46
final class Decorations {
47
    
47
    
48
    private static final SimpleFormatter FORMATTER = new SimpleFormatter();
48
    private static final SimpleFormatter FORMATTER = new SimpleFormatter();
49
    
49
    
50
    public static void decorate(LogRecord r, Decorable d) {
50
    static void decorate(LogRecord r, Decorable d) {
51
        if (r.getMessage() == null) {
51
        if (r.getMessage() == null) {
52
            d.setName("Seq: " + r.getSequenceNumber());
52
            d.setName("Seq: " + r.getSequenceNumber());
53
        } else {
53
        } else {
(-)a/lib.uihandler/src/org/netbeans/lib/uihandler/InputGesture.java (-1 / +1 lines)
Lines 46-52 Link Here
46
    
46
    
47
    /** Finds the right InputGesture for given LogRecord.
47
    /** Finds the right InputGesture for given LogRecord.
48
     * @param rec the record
48
     * @param rec the record
49
     * @return the gesture that initated the record or null if unknown
49
     * @return the gesture that initiated the record or <code>null</code> if unknown
50
     */
50
     */
51
    public static InputGesture valueOf(LogRecord rec) {
51
    public static InputGesture valueOf(LogRecord rec) {
52
        if ("UI_ACTION_BUTTON_PRESS".equals(rec.getMessage())) {
52
        if ("UI_ACTION_BUTTON_PRESS".equals(rec.getMessage())) {
(-)a/lib.uihandler/src/org/netbeans/lib/uihandler/LogRecords.java (+18 lines)
Lines 87-92 Link Here
87
        Decorations.decorate(r, d);
87
        Decorations.decorate(r, d);
88
    }
88
    }
89
    
89
    
90
    /**
91
     * Writhe log record to an output stream.
92
     * @param os the output stream
93
     * @param rec the log record
94
     * @throws IOException when an I/O error occurs.
95
     */
90
    public static void write(OutputStream os, LogRecord rec) throws IOException {           
96
    public static void write(OutputStream os, LogRecord rec) throws IOException {           
91
        String formated = FORMATTER.format(rec);
97
        String formated = FORMATTER.format(rec);
92
        byte[] arr = formated.getBytes("utf-8");
98
        byte[] arr = formated.getBytes("utf-8");
Lines 139-144 Link Here
139
145
140
    }
146
    }
141
147
148
    /**
149
     * Scan log records stored in a file.
150
     * @param f the file to read log records from
151
     * @param h handler that gets the log records
152
     * @throws IOException when an I/O error occurs.
153
     */
142
    public static void scan(File f, Handler h) throws IOException {
154
    public static void scan(File f, Handler h) throws IOException {
143
        HandlerDelegate hd = new HandlerDelegate(h);
155
        HandlerDelegate hd = new HandlerDelegate(h);
144
        InputStream is = null;
156
        InputStream is = null;
Lines 173-178 Link Here
173
        }
185
        }
174
    }
186
    }
175
    
187
    
188
    /**
189
     * Scan log records from an input stream.
190
     * @param is the input stream to read log records from
191
     * @param h handler that gets the log records
192
     * @throws IOException when an I/O error occurs.
193
     */
176
    public static void scan(InputStream is, Handler h) throws IOException {
194
    public static void scan(InputStream is, Handler h) throws IOException {
177
        List<LogRecord> errorLogRecords = new ArrayList<LogRecord>();
195
        List<LogRecord> errorLogRecords = new ArrayList<LogRecord>();
178
        try {
196
        try {
(-)a/lib.uihandler/src/org/netbeans/lib/uihandler/MultiPartHandler.java (-1 / +1 lines)
Lines 53-59 Link Here
53
import java.util.HashMap;
53
import java.util.HashMap;
54
import java.util.Vector;
54
import java.util.Vector;
55
55
56
public class MultiPartHandler {
56
class MultiPartHandler {
57
  public interface InputFacade {
57
  public interface InputFacade {
58
      public int readLine(byte[] arr, int off, int len) throws IOException;
58
      public int readLine(byte[] arr, int off, int len) throws IOException;
59
      public InputStream getInputStream();
59
      public InputStream getInputStream();
(-)a/lib.uihandler/src/org/netbeans/lib/uihandler/NBBugzillaAccessor.java (-3 / +3 lines)
Lines 43-51 Link Here
43
package org.netbeans.lib.uihandler;
43
package org.netbeans.lib.uihandler;
44
44
45
/**
45
/**
46
 * The implementation will provide access to netbeans.org specific bagzilla
46
 * The implementation will provide access to netbeans.org specific bugzilla
47
 * functionality. Additionaly, methods are available to share the nb username
47
 * functionality. Additionally, methods are available to share the nb username
48
 * and password between the bugzilla and exeption reporter modules.
48
 * and password between the bugzilla and exception reporter modules.
49
 *
49
 *
50
 *
50
 *
51
 * @author Tomas Stupka
51
 * @author Tomas Stupka
(-)a/lib.uihandler/src/org/netbeans/lib/uihandler/PasswdEncryption.java (-2 / +48 lines)
Lines 37-47 Link Here
37
import java.security.PrivateKey;
37
import java.security.PrivateKey;
38
import java.security.PublicKey;
38
import java.security.PublicKey;
39
import java.security.spec.X509EncodedKeySpec;
39
import java.security.spec.X509EncodedKeySpec;
40
import java.util.Arrays;
41
import javax.crypto.Cipher;
40
import javax.crypto.Cipher;
42
41
43
/**
42
/**
44
 *
43
 * Password encryption/decryption utilities.
44
 * 
45
 * @author Jindrich Sedek
45
 * @author Jindrich Sedek
46
 */
46
 */
47
public class PasswdEncryption {
47
public class PasswdEncryption {
Lines 49-62 Link Here
49
    private static final String delimiter = ":"; //NOI18N
49
    private static final String delimiter = ":"; //NOI18N
50
    public static final int MAX_ENCRYPTION_LENGHT = 100;
50
    public static final int MAX_ENCRYPTION_LENGHT = 100;
51
    
51
    
52
    /**
53
     * Encrypt a text with a default public key.
54
     * @param text text to encrypt
55
     * @return encrypted text
56
     * @throws IOException when I/O error occurs
57
     * @throws GeneralSecurityException when transformation error occurs
58
     */
52
    public static String encrypt(String text) throws IOException, GeneralSecurityException {
59
    public static String encrypt(String text) throws IOException, GeneralSecurityException {
53
        return encrypt(text, getPublicKey());
60
        return encrypt(text, getPublicKey());
54
    }
61
    }
55
62
63
    /**
64
     * Encrypt a sequence of bytes a default public key.
65
     * @param text byte array to encrypt
66
     * @return encrypted bytes
67
     * @throws IOException when I/O error occurs
68
     * @throws GeneralSecurityException when transformation error occurs
69
     */
56
    public static byte[] encrypt(byte[] text) throws IOException, GeneralSecurityException {
70
    public static byte[] encrypt(byte[] text) throws IOException, GeneralSecurityException {
57
        return encrypt(text, getPublicKey());
71
        return encrypt(text, getPublicKey());
58
    }
72
    }
59
73
74
    /**
75
     * Encrypt a sequence of bytes.
76
     * @param text byte array to encrypt
77
     * @param key the public key used for the encryption
78
     * @return encrypted bytes
79
     * @throws IOException when I/O error occurs
80
     * @throws GeneralSecurityException when transformation error occurs
81
     */
60
    public static byte[] encrypt(byte[] text, PublicKey key) throws IOException, GeneralSecurityException {
82
    public static byte[] encrypt(byte[] text, PublicKey key) throws IOException, GeneralSecurityException {
61
        assert (text.length <= MAX_ENCRYPTION_LENGHT);
83
        assert (text.length <= MAX_ENCRYPTION_LENGHT);
62
        Cipher rsaCipher = Cipher.getInstance("RSA/ECB/PKCS1Padding"); // NOI18N
84
        Cipher rsaCipher = Cipher.getInstance("RSA/ECB/PKCS1Padding"); // NOI18N
Lines 66-71 Link Here
66
        return encoded;
88
        return encoded;
67
    }
89
    }
68
90
91
    /**
92
     * Decrypt a sequence of bytes.
93
     * @param text byte array to decrypt
94
     * @param key the private key used for the decryption
95
     * @return decrypted bytes
96
     * @throws IOException when I/O error occurs
97
     * @throws GeneralSecurityException when transformation error occurs
98
     */
69
    public static byte[] decrypt(byte[] text, PrivateKey key) throws IOException, GeneralSecurityException {
99
    public static byte[] decrypt(byte[] text, PrivateKey key) throws IOException, GeneralSecurityException {
70
        Cipher rsaCipher = Cipher.getInstance("RSA/ECB/PKCS1Padding"); // NOI18N
100
        Cipher rsaCipher = Cipher.getInstance("RSA/ECB/PKCS1Padding"); // NOI18N
71
        rsaCipher.init(Cipher.DECRYPT_MODE, key);
101
        rsaCipher.init(Cipher.DECRYPT_MODE, key);
Lines 74-84 Link Here
74
        return decoded;
104
        return decoded;
75
    }
105
    }
76
106
107
    /**
108
     * Encrypt a text.
109
     * @param text text to encrypt
110
     * @param key the public key used for the encryption
111
     * @return encrypted text
112
     * @throws IOException when I/O error occurs
113
     * @throws GeneralSecurityException when transformation error occurs
114
     */
77
    public static String encrypt(String text, PublicKey key) throws IOException, GeneralSecurityException {
115
    public static String encrypt(String text, PublicKey key) throws IOException, GeneralSecurityException {
78
        byte[] encrypted = encrypt(text.getBytes(), key);
116
        byte[] encrypted = encrypt(text.getBytes(), key);
79
        return arrayToString(encrypted);
117
        return arrayToString(encrypted);
80
    }
118
    }
81
119
120
    /**
121
     * Decrypt a text.
122
     * @param text text to decrypt
123
     * @param key the private key used for the decryption
124
     * @return decrypted text
125
     * @throws IOException when I/O error occurs
126
     * @throws GeneralSecurityException when transformation error occurs
127
     */
82
    public static String decrypt(String text, PrivateKey key) throws IOException, GeneralSecurityException {
128
    public static String decrypt(String text, PrivateKey key) throws IOException, GeneralSecurityException {
83
        byte[] decrypted = decrypt(stringToArray(text), key);
129
        byte[] decrypted = decrypt(stringToArray(text), key);
84
        return new String(decrypted);
130
        return new String(decrypted);
(-)a/lib.uihandler/src/org/netbeans/lib/uihandler/ProjectOp.java (-1 / +1 lines)
Lines 38-44 Link Here
38
 * @author Jaroslav Tulach
38
 * @author Jaroslav Tulach
39
 * @since 1.7
39
 * @since 1.7
40
 */
40
 */
41
public final class ProjectOp {
41
final class ProjectOp {
42
    private final String name;
42
    private final String name;
43
    private final String type;
43
    private final String type;
44
    private final boolean startup;
44
    private final boolean startup;
(-)a/nbbuild/build.properties (-3 / +3 lines)
Lines 159-165 Link Here
159
    db,\
159
    db,\
160
    spi.quicksearch,\
160
    spi.quicksearch,\
161
    print,\
161
    print,\
162
    extexecution
162
    extexecution,\
163
    lib.uihandler,\
164
    uihandler
163
165
164
#FIXME: changes for retouche merge:
166
#FIXME: changes for retouche merge:
165
#   editor/codetemplates,\
167
#   editor/codetemplates,\
Lines 205-213 Link Here
205
    java.api.common,\
207
    java.api.common,\
206
    java.j2seproject,\
208
    java.j2seproject,\
207
    junit,\
209
    junit,\
208
    uihandler,\
209
    versioning.core,\
210
    versioning.core,\
210
    lib.uihandler,\
211
    masterfs,\
211
    masterfs,\
212
    projectui
212
    projectui
213
213
(-)a/nbbuild/cluster.properties (-3 / +3 lines)
Lines 179-184 Link Here
179
        javahelp,\
179
        javahelp,\
180
        keyring,\
180
        keyring,\
181
        keyring.impl,\
181
        keyring.impl,\
182
        lib.uihandler,\
182
        libs.felix,\
183
        libs.felix,\
183
        libs.jna,\
184
        libs.jna,\
184
        libs.jsr223,\
185
        libs.jsr223,\
Lines 222-228 Link Here
222
        sendopts,\
223
        sendopts,\
223
        settings,\
224
        settings,\
224
        spi.actions,\
225
        spi.actions,\
225
        spi.quicksearch
226
        spi.quicksearch,\
227
        uihandler
226
validation.nb.cluster.platform=\
228
validation.nb.cluster.platform=\
227
        o.n.core,\
229
        o.n.core,\
228
        core.windows,\
230
        core.windows,\
Lines 736-744 Link Here
736
        bugzilla.exceptionreporter,\
738
        bugzilla.exceptionreporter,\
737
        ide.branding,\
739
        ide.branding,\
738
        ide.branding.kit,\
740
        ide.branding.kit,\
739
        lib.uihandler,\
740
        o.n.upgrader,\
741
        o.n.upgrader,\
741
        uihandler,\
742
        uihandler.exceptionreporter,\
742
        uihandler.exceptionreporter,\
743
        updatecenters,\
743
        updatecenters,\
744
        welcome
744
        welcome
(-)a/uihandler/nbproject/project.xml (-1 / +1 lines)
Lines 63-69 Link Here
63
                    <build-prerequisite/>
63
                    <build-prerequisite/>
64
                    <compile-dependency/>
64
                    <compile-dependency/>
65
                    <run-dependency>
65
                    <run-dependency>
66
                        <specification-version>1.33</specification-version>
66
                        <specification-version>1.37</specification-version>
67
                    </run-dependency>
67
                    </run-dependency>
68
                </dependency>
68
                </dependency>
69
                <dependency>
69
                <dependency>
(-)a/uihandler/src/org/netbeans/modules/uihandler/api/Activated.java (+5 lines)
Lines 53-57 Link Here
53
 * @author Jaroslav Tulach
53
 * @author Jaroslav Tulach
54
 */
54
 */
55
public interface Activated {
55
public interface Activated {
56
    
57
    /**
58
     * Called when the UI logger is activated.
59
     * @param uiLogger the activated UI logger
60
     */
56
    public void activated(Logger uiLogger);
61
    public void activated(Logger uiLogger);
57
}
62
}
(-)a/uihandler/src/org/netbeans/modules/uihandler/api/Deactivated.java (+5 lines)
Lines 53-57 Link Here
53
 * @author Jaroslav Tulach
53
 * @author Jaroslav Tulach
54
 */
54
 */
55
public interface Deactivated {
55
public interface Deactivated {
56
    
57
    /**
58
     * Called when the UI logger is deactivated.
59
     * @param uiLogger the deactivated UI logger
60
     */
56
    public void deactivated(Logger uiLogger);
61
    public void deactivated(Logger uiLogger);
57
}
62
}

Return to bug 229019