org.tizen.web.compressor.minifier.ui_2.0.0.201311011708

16:50:37.757 INFO  jd.cli.Main - Decompiling org.tizen.web.compressor.minifier.ui_2.0.0.201311011708.jar
package org.tizen.web.compressor.minifier.ui;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.tizen.common.util.PluginUtil;
import org.tizen.web.compressor.minifier.core.IMinifier;
import org.tizen.web.compressor.minifier.core.Minifier;

public class Activator
  extends AbstractUIPlugin
{
  protected final Logger logger = LoggerFactory.getLogger(getClass());
  public static final String PLUGIN_ID = "org.tizen.web.compressor.minifier.ui";
  private static Activator plugin;
  protected Minifier minifier;
  
  public void start(BundleContext context)
    throws Exception
  {
    super.start(context);
    plugin = this;
  }
  
  public void stop(BundleContext context)
    throws Exception
  {
    plugin = null;
    super.stop(context);
  }
  
  public static Activator getDefault()
  {
    return plugin;
  }
  
  public synchronized Minifier getMinifier()
    throws CoreException
  {
    if (minifier == null)
    {
      minifier = new Minifier();
      Object[] objs = PluginUtil.loadClasses("org.tizen.web.compressor.minifier");
      if (objs == null)
      {
        logger.info("No minifier");
      }
      else
      {
        Object[] arrayOfObject1;
        int j = (arrayOfObject1 = objs).length;
        for (int i = 0; i < j; i++)
        {
          Object obj = arrayOfObject1[i];
          logger.debug("Minifier: {}", obj);
          minifier.addMinifier((IMinifier)obj);
        }
      }
    }
    return minifier;
  }
}

/* Location:
 * Qualified Name:     org.tizen.web.compressor.minifier.ui.Activator
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.web.compressor.minifier.ui;

import org.eclipse.osgi.util.NLS;

public class Messages
  extends NLS
{
  private static final String BUNDLE_NAME = "org.tizen.web.compressor.minifier.ui.messages";
  public static String MinifyError_NoMinifier;
  public static String MinifyError_CompressError;
  public static String MinifyTitleFormat;
  public static String MinifySuccess;
  public static String MinifyErrorFormat;
  
  static
  {
    NLS.initializeMessages("org.tizen.web.compressor.minifier.ui.messages", Messages.class);
  }
}

/* Location:
 * Qualified Name:     org.tizen.web.compressor.minifier.ui.Messages
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.web.compressor.minifier.ui.handlers;

import java.io.File;
import java.io.IOException;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.IHandler;
import org.eclipse.core.resources.IFile;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITreeSelection;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.handlers.HandlerUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.tizen.common.util.FileUtil;
import org.tizen.common.util.log.UserLogger;

public class MinifierHandler
  extends AbstractHandler
  implements IHandler
{
  protected final Logger logger = LoggerFactory.getLogger(getClass());
  public static final String MINIFIER_FILE_POSTFIX = "min.";
  
  public Object execute(ExecutionEvent event)
    throws ExecutionException
  {
    UserLogger.event("web.build.minify");
    
    ISelection selection = HandlerUtil.getCurrentSelectionChecked(event);
    logger.trace("Selection: {}", selection);
    if ((selection instanceof ITreeSelection))
    {
      Object object = ((IStructuredSelection)selection).getFirstElement();
      IFile file = (IFile)object;
      fileHandlerExecute(file);
    }
    else
    {
      IEditorPart editor = HandlerUtil.getActiveEditor(event);
      editorHandlerExecute(editor);
    }
    return null;
  }
  
  /* Error */
  protected void fileHandlerExecute(IFile file)
  {
    // Byte code:
    //   0: aload_1
    //   1: ifnull +12 -> 13
    //   4: aload_1
    //   5: invokeinterface 98 1 0
    //   10: ifne +4 -> 14
    //   13: return
    //   14: aload_1
    //   15: invokeinterface 102 1 0
    //   20: astore_2
    //   21: aload_1
    //   22: invokeinterface 106 1 0
    //   27: astore_3
    //   28: aload_0
    //   29: getfield 31	org/tizen/web/compressor/minifier/ui/handlers/MinifierHandler:logger	Lorg/slf4j/Logger;
    //   32: ldc 109
    //   34: aload_2
    //   35: invokeinterface 58 3 0
    //   40: aconst_null
    //   41: astore 4
    //   43: aconst_null
    //   44: astore 5
    //   46: invokestatic 111	org/tizen/web/compressor/minifier/ui/Activator:getDefault	()Lorg/tizen/web/compressor/minifier/ui/Activator;
    //   49: invokevirtual 117	org/tizen/web/compressor/minifier/ui/Activator:getMinifier	()Lorg/tizen/web/compressor/minifier/core/Minifier;
    //   52: astore 6
    //   54: aload_0
    //   55: getfield 31	org/tizen/web/compressor/minifier/ui/handlers/MinifierHandler:logger	Lorg/slf4j/Logger;
    //   58: ldc 109
    //   60: aload 6
    //   62: invokeinterface 121 3 0
    //   67: aload_1
    //   68: invokeinterface 124 1 0
    //   73: astore 4
    //   75: new 128	java/io/ByteArrayOutputStream
    //   78: dup
    //   79: invokespecial 130	java/io/ByteArrayOutputStream:<init>	()V
    //   82: astore 5
    //   84: aload 6
    //   86: aload_2
    //   87: aload 4
    //   89: aload 5
    //   91: invokevirtual 131	org/tizen/web/compressor/minifier/core/Minifier:compress	(Ljava/lang/String;Ljava/io/InputStream;Ljava/io/OutputStream;)V
    //   94: aload_1
    //   95: invokeinterface 137 1 0
    //   100: invokeinterface 141 1 0
    //   105: astore 7
    //   107: aload 7
    //   109: iconst_0
    //   110: aload 7
    //   112: aload_3
    //   113: invokevirtual 146	java/lang/String:lastIndexOf	(Ljava/lang/String;)I
    //   116: invokevirtual 152	java/lang/String:substring	(II)Ljava/lang/String;
    //   119: astore 8
    //   121: new 156	java/lang/StringBuilder
    //   124: dup
    //   125: aload 8
    //   127: invokestatic 158	java/lang/String:valueOf	(Ljava/lang/Object;)Ljava/lang/String;
    //   130: invokespecial 162	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   133: ldc 12
    //   135: invokevirtual 164	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   138: aload_3
    //   139: invokevirtual 164	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   142: invokevirtual 168	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   145: astore 8
    //   147: aload_0
    //   148: aload 8
    //   150: aload 5
    //   152: invokevirtual 171	java/lang/Object:toString	()Ljava/lang/String;
    //   155: invokevirtual 172	org/tizen/web/compressor/minifier/ui/handlers/MinifierHandler:createFile	(Ljava/lang/String;Ljava/lang/String;)Z
    //   158: ifeq +142 -> 300
    //   161: aload_1
    //   162: invokeinterface 176 1 0
    //   167: iconst_2
    //   168: aconst_null
    //   169: invokeinterface 180 3 0
    //   174: getstatic 186	org/tizen/web/compressor/minifier/ui/Messages:MinifyTitleFormat	Ljava/lang/String;
    //   177: iconst_1
    //   178: anewarray 20	java/lang/Object
    //   181: dup
    //   182: iconst_0
    //   183: aload_3
    //   184: invokevirtual 191	java/lang/String:toUpperCase	()Ljava/lang/String;
    //   187: aastore
    //   188: invokestatic 194	java/text/MessageFormat:format	(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
    //   191: astore 9
    //   193: aload 9
    //   195: getstatic 200	org/tizen/web/compressor/minifier/ui/Messages:MinifySuccess	Ljava/lang/String;
    //   198: getstatic 203	org/tizen/common/util/NotificationType:SUCCESS	Lorg/tizen/common/util/NotificationType;
    //   201: invokestatic 209	org/tizen/common/util/NotifierDialog:notify	(Ljava/lang/String;Ljava/lang/String;Lorg/tizen/common/util/NotificationType;)V
    //   204: goto +96 -> 300
    //   207: astore 6
    //   209: getstatic 186	org/tizen/web/compressor/minifier/ui/Messages:MinifyTitleFormat	Ljava/lang/String;
    //   212: iconst_1
    //   213: anewarray 20	java/lang/Object
    //   216: dup
    //   217: iconst_0
    //   218: aload_3
    //   219: invokevirtual 191	java/lang/String:toUpperCase	()Ljava/lang/String;
    //   222: aastore
    //   223: invokestatic 194	java/text/MessageFormat:format	(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
    //   226: astore 7
    //   228: getstatic 215	org/tizen/web/compressor/minifier/ui/Messages:MinifyErrorFormat	Ljava/lang/String;
    //   231: iconst_1
    //   232: anewarray 20	java/lang/Object
    //   235: dup
    //   236: iconst_0
    //   237: aload 6
    //   239: invokevirtual 218	java/lang/Exception:getMessage	()Ljava/lang/String;
    //   242: aastore
    //   243: invokestatic 194	java/text/MessageFormat:format	(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
    //   246: astore 8
    //   248: aload 7
    //   250: aload 8
    //   252: getstatic 223	org/tizen/common/util/NotificationType:ERROR	Lorg/tizen/common/util/NotificationType;
    //   255: invokestatic 209	org/tizen/common/util/NotifierDialog:notify	(Ljava/lang/String;Ljava/lang/String;Lorg/tizen/common/util/NotificationType;)V
    //   258: iconst_2
    //   259: anewarray 20	java/lang/Object
    //   262: dup
    //   263: iconst_0
    //   264: aload 4
    //   266: aastore
    //   267: dup
    //   268: iconst_1
    //   269: aload 5
    //   271: aastore
    //   272: invokestatic 226	org/tizen/common/util/IOUtil:tryClose	([Ljava/lang/Object;)V
    //   275: goto +42 -> 317
    //   278: astore 10
    //   280: iconst_2
    //   281: anewarray 20	java/lang/Object
    //   284: dup
    //   285: iconst_0
    //   286: aload 4
    //   288: aastore
    //   289: dup
    //   290: iconst_1
    //   291: aload 5
    //   293: aastore
    //   294: invokestatic 226	org/tizen/common/util/IOUtil:tryClose	([Ljava/lang/Object;)V
    //   297: aload 10
    //   299: athrow
    //   300: iconst_2
    //   301: anewarray 20	java/lang/Object
    //   304: dup
    //   305: iconst_0
    //   306: aload 4
    //   308: aastore
    //   309: dup
    //   310: iconst_1
    //   311: aload 5
    //   313: aastore
    //   314: invokestatic 226	org/tizen/common/util/IOUtil:tryClose	([Ljava/lang/Object;)V
    //   317: return
    // Line number table:
    //   Java source line #104	-> byte code offset #0
    //   Java source line #105	-> byte code offset #13
    //   Java source line #108	-> byte code offset #14
    //   Java source line #109	-> byte code offset #21
    //   Java source line #111	-> byte code offset #28
    //   Java source line #113	-> byte code offset #40
    //   Java source line #114	-> byte code offset #43
    //   Java source line #116	-> byte code offset #46
    //   Java source line #117	-> byte code offset #54
    //   Java source line #119	-> byte code offset #67
    //   Java source line #120	-> byte code offset #75
    //   Java source line #121	-> byte code offset #84
    //   Java source line #124	-> byte code offset #94
    //   Java source line #125	-> byte code offset #107
    //   Java source line #126	-> byte code offset #121
    //   Java source line #127	-> byte code offset #147
    //   Java source line #129	-> byte code offset #161
    //   Java source line #130	-> byte code offset #174
    //   Java source line #131	-> byte code offset #193
    //   Java source line #133	-> byte code offset #207
    //   Java source line #134	-> byte code offset #209
    //   Java source line #135	-> byte code offset #228
    //   Java source line #136	-> byte code offset #248
    //   Java source line #137	-> byte code offset #258
    //   Java source line #138	-> byte code offset #264
    //   Java source line #137	-> byte code offset #278
    //   Java source line #138	-> byte code offset #286
    //   Java source line #139	-> byte code offset #297
    //   Java source line #137	-> byte code offset #300
    //   Java source line #138	-> byte code offset #306
    //   Java source line #140	-> byte code offset #317
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	318	0	this	MinifierHandler
    //   0	318	1	file	IFile
    //   20	67	2	fileName	String
    //   27	192	3	fileExt	String
    //   41	266	4	in	java.io.InputStream
    //   44	268	5	out	java.io.OutputStream
    //   52	33	6	minifier	org.tizen.web.compressor.minifier.core.Minifier
    //   207	31	6	e	Exception
    //   105	6	7	fullPath	String
    //   226	23	7	notifierDialogTitle	String
    //   119	30	8	minPath	String
    //   246	5	8	notifierDialogMessage	String
    //   191	3	9	notifierDialogTitle	String
    //   278	20	10	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   46	204	207	java/lang/Exception
    //   46	258	278	finally
  }
  
  /* Error */
  protected void editorHandlerExecute(IEditorPart editorPart)
  {
    // Byte code:
    //   0: aload_1
    //   1: ifnonnull +4 -> 5
    //   4: return
    //   5: aload_1
    //   6: invokeinterface 252 1 0
    //   11: astore_2
    //   12: aload_2
    //   13: instanceof 258
    //   16: ifne +4 -> 20
    //   19: return
    //   20: aload_0
    //   21: getfield 31	org/tizen/web/compressor/minifier/ui/handlers/MinifierHandler:logger	Lorg/slf4j/Logger;
    //   24: ldc 109
    //   26: aload_2
    //   27: invokeinterface 260 1 0
    //   32: invokeinterface 58 3 0
    //   37: aload_1
    //   38: ldc_w 263
    //   41: invokeinterface 265 2 0
    //   46: checkcast 263	org/eclipse/jface/text/IDocument
    //   49: astore_3
    //   50: aload_3
    //   51: ifnonnull +33 -> 84
    //   54: aload_1
    //   55: checkcast 269	org/eclipse/ui/texteditor/ITextEditor
    //   58: astore 4
    //   60: aload 4
    //   62: invokeinterface 271 1 0
    //   67: astore 5
    //   69: aload 5
    //   71: aload 4
    //   73: invokeinterface 275 1 0
    //   78: invokeinterface 276 2 0
    //   83: astore_3
    //   84: aconst_null
    //   85: astore 4
    //   87: aconst_null
    //   88: astore 5
    //   90: invokestatic 111	org/tizen/web/compressor/minifier/ui/Activator:getDefault	()Lorg/tizen/web/compressor/minifier/ui/Activator;
    //   93: invokevirtual 117	org/tizen/web/compressor/minifier/ui/Activator:getMinifier	()Lorg/tizen/web/compressor/minifier/core/Minifier;
    //   96: astore 6
    //   98: aload_0
    //   99: getfield 31	org/tizen/web/compressor/minifier/ui/handlers/MinifierHandler:logger	Lorg/slf4j/Logger;
    //   102: ldc 109
    //   104: aload 6
    //   106: invokeinterface 121 3 0
    //   111: new 282	java/io/ByteArrayInputStream
    //   114: dup
    //   115: aload_3
    //   116: invokeinterface 284 1 0
    //   121: invokevirtual 287	java/lang/String:getBytes	()[B
    //   124: invokespecial 291	java/io/ByteArrayInputStream:<init>	([B)V
    //   127: astore 4
    //   129: new 128	java/io/ByteArrayOutputStream
    //   132: dup
    //   133: invokespecial 130	java/io/ByteArrayOutputStream:<init>	()V
    //   136: astore 5
    //   138: aload 6
    //   140: aload_2
    //   141: invokeinterface 260 1 0
    //   146: aload 4
    //   148: aload 5
    //   150: invokevirtual 131	org/tizen/web/compressor/minifier/core/Minifier:compress	(Ljava/lang/String;Ljava/io/InputStream;Ljava/io/OutputStream;)V
    //   153: aload_3
    //   154: aload 5
    //   156: invokevirtual 171	java/lang/Object:toString	()Ljava/lang/String;
    //   159: invokeinterface 294 2 0
    //   164: goto +97 -> 261
    //   167: astore 6
    //   169: aload_0
    //   170: getfield 31	org/tizen/web/compressor/minifier/ui/handlers/MinifierHandler:logger	Lorg/slf4j/Logger;
    //   173: getstatic 297	org/tizen/web/compressor/minifier/ui/Messages:MinifyError_NoMinifier	Ljava/lang/String;
    //   176: aload 6
    //   178: invokeinterface 300 3 0
    //   183: iconst_2
    //   184: anewarray 20	java/lang/Object
    //   187: dup
    //   188: iconst_0
    //   189: aload 4
    //   191: aastore
    //   192: dup
    //   193: iconst_1
    //   194: aload 5
    //   196: aastore
    //   197: invokestatic 226	org/tizen/common/util/IOUtil:tryClose	([Ljava/lang/Object;)V
    //   200: goto +78 -> 278
    //   203: astore 6
    //   205: aload_0
    //   206: getfield 31	org/tizen/web/compressor/minifier/ui/handlers/MinifierHandler:logger	Lorg/slf4j/Logger;
    //   209: getstatic 304	org/tizen/web/compressor/minifier/ui/Messages:MinifyError_CompressError	Ljava/lang/String;
    //   212: aload 6
    //   214: invokeinterface 307 3 0
    //   219: iconst_2
    //   220: anewarray 20	java/lang/Object
    //   223: dup
    //   224: iconst_0
    //   225: aload 4
    //   227: aastore
    //   228: dup
    //   229: iconst_1
    //   230: aload 5
    //   232: aastore
    //   233: invokestatic 226	org/tizen/common/util/IOUtil:tryClose	([Ljava/lang/Object;)V
    //   236: goto +42 -> 278
    //   239: astore 7
    //   241: iconst_2
    //   242: anewarray 20	java/lang/Object
    //   245: dup
    //   246: iconst_0
    //   247: aload 4
    //   249: aastore
    //   250: dup
    //   251: iconst_1
    //   252: aload 5
    //   254: aastore
    //   255: invokestatic 226	org/tizen/common/util/IOUtil:tryClose	([Ljava/lang/Object;)V
    //   258: aload 7
    //   260: athrow
    //   261: iconst_2
    //   262: anewarray 20	java/lang/Object
    //   265: dup
    //   266: iconst_0
    //   267: aload 4
    //   269: aastore
    //   270: dup
    //   271: iconst_1
    //   272: aload 5
    //   274: aastore
    //   275: invokestatic 226	org/tizen/common/util/IOUtil:tryClose	([Ljava/lang/Object;)V
    //   278: return
    // Line number table:
    //   Java source line #143	-> byte code offset #0
    //   Java source line #144	-> byte code offset #4
    //   Java source line #147	-> byte code offset #5
    //   Java source line #148	-> byte code offset #12
    //   Java source line #149	-> byte code offset #19
    //   Java source line #152	-> byte code offset #20
    //   Java source line #155	-> byte code offset #37
    //   Java source line #156	-> byte code offset #50
    //   Java source line #157	-> byte code offset #54
    //   Java source line #158	-> byte code offset #60
    //   Java source line #159	-> byte code offset #69
    //   Java source line #162	-> byte code offset #84
    //   Java source line #163	-> byte code offset #87
    //   Java source line #165	-> byte code offset #90
    //   Java source line #166	-> byte code offset #98
    //   Java source line #168	-> byte code offset #111
    //   Java source line #169	-> byte code offset #129
    //   Java source line #170	-> byte code offset #138
    //   Java source line #173	-> byte code offset #153
    //   Java source line #174	-> byte code offset #167
    //   Java source line #175	-> byte code offset #169
    //   Java source line #178	-> byte code offset #183
    //   Java source line #179	-> byte code offset #189
    //   Java source line #176	-> byte code offset #203
    //   Java source line #177	-> byte code offset #205
    //   Java source line #178	-> byte code offset #219
    //   Java source line #179	-> byte code offset #225
    //   Java source line #178	-> byte code offset #239
    //   Java source line #179	-> byte code offset #247
    //   Java source line #180	-> byte code offset #258
    //   Java source line #178	-> byte code offset #261
    //   Java source line #179	-> byte code offset #267
    //   Java source line #181	-> byte code offset #278
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	279	0	this	MinifierHandler
    //   0	279	1	editorPart	IEditorPart
    //   11	130	2	editorInput	org.eclipse.ui.IEditorInput
    //   49	105	3	document	org.eclipse.jface.text.IDocument
    //   58	14	4	textEditor	org.eclipse.ui.texteditor.ITextEditor
    //   85	183	4	in	java.io.InputStream
    //   67	3	5	documentProvider	org.eclipse.ui.texteditor.IDocumentProvider
    //   88	185	5	out	java.io.OutputStream
    //   96	43	6	minifier	org.tizen.web.compressor.minifier.core.Minifier
    //   167	10	6	e	org.eclipse.core.runtime.CoreException
    //   203	10	6	e	Exception
    //   239	20	7	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   90	164	167	org/eclipse/core/runtime/CoreException
    //   90	164	203	java/lang/Exception
    //   90	183	239	finally
    //   203	219	239	finally
  }
  
  protected boolean createFile(String path, String content)
    throws IOException
  {
    boolean bSuccess = false;
    if (!FileUtil.isExist(path)) {
      bSuccess = FileUtil.createTextFile(path, content, null);
    } else {
      bSuccess = FileUtil.writeTextFile(new File(path), content, null);
    }
    return bSuccess;
  }
}

/* Location:
 * Qualified Name:     org.tizen.web.compressor.minifier.ui.handlers.MinifierHandler
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
1

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd