import com.sun.org.apache.xerces.internal.impl.dv.util.Base64;
/**
- * PluginUtil
+ * CipherUtil
*
* This is a util class for encrypting and decrypting plain texts.
*
*/
public class CipherUtil {
- private static final String password = "ANYLINKhijklmnopqrstuvwx";
+ private static final String password = "KYANINYLhijklmnopqrstuvwx";
private static SecretKey SECRETE_KEY;
private static Cipher DES_CIPHER;
private static final String ALGORITHM = "DESede";
DES_CIPHER = Cipher.getInstance(ALGORITHM + "/ECB/PKCS5Padding");
} catch (Throwable t) {
- Logger.error("Exception occurred while creating secrete key", t);
+ Logger.error("Exception occurred while creating secret key", t);
}
}
import java.awt.Dimension;
import java.awt.Toolkit;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
+import java.util.List;
import java.util.Stack;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.events.VerifyEvent;
}
c.setLayoutData(gd);
}
+
+ /**
+ * Make error dialog which prints stack trace of the throwable
+ *
+ * @param title title of the dialog
+ * @param msg message of the dialog
+ * @param t throwable diaog prints out
+ * @param shell parent shell of this dialog
+ * @author Ho Namkoong {@literal <ho.namkoong@samsung.com>} (S-Core)
+ */
+ public static void errorDialogWithStackTrace(String title, String msg, Throwable t, String pluginId, Shell shell) {
+
+ StringWriter sw = new StringWriter();
+ PrintWriter pw = new PrintWriter(sw);
+ t.printStackTrace(pw);
+
+ final String trace = sw.toString();
+
+ List<Status> childStatuses = new ArrayList<Status>();
+
+ for(String line: trace.split("\n")) {
+ childStatuses.add(new Status(IStatus.ERROR, pluginId, line));
+ }
+
+ MultiStatus ms = new MultiStatus(pluginId, IStatus.ERROR, childStatuses.toArray(new Status[] {}), t.getLocalizedMessage(), t);
+
+ ErrorDialog.openError(shell, "Error Dialog", msg, ms);
+ }
}