org.tizen.nativecpp.uibuilder.launcher_0.5.0.201311042022

16:50:19.226 INFO  jd.cli.Main - Decompiling org.tizen.nativecpp.uibuilder.launcher_0.5.0.201311042022.jar
package org.tizen.nativecpp.uibuilder.codegen;

import java.util.ArrayList;
import java.util.List;
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier.ICPPASTBaseSpecifier;
import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.model.ICModel;
import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.core.model.ITranslationUnit;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;

public class AstHeaderUnitUtil
{
  public static List<ITranslationUnit> getHeaderUnitList(ICProject cProject)
  {
    List<ITranslationUnit> ret = new ArrayList();
    if ((cProject == null) || (!cProject.exists())) {
      return ret;
    }
    List<ITranslationUnit> transUnitList = CDTFileUtil.getTranslationUnitList(cProject);
    for (ITranslationUnit transUnit : transUnitList) {
      if (transUnit.isHeaderUnit()) {
        ret.add(transUnit);
      }
    }
    return ret;
  }
  
  public static boolean isA(String strSuperClassName, ICPPASTCompositeTypeSpecifier astClassSpecer)
  {
    boolean ret = false;
    if ((strSuperClassName == null) || (strSuperClassName.isEmpty()) || (astClassSpecer == null)) {
      return ret;
    }
    IASTNode[] arrayOfIASTNode;
    int j = (arrayOfIASTNode = astClassSpecer.getChildren()).length;
    for (int i = 0; i < j; i++)
    {
      IASTNode astChild = arrayOfIASTNode[i];
      if ((astChild instanceof ICPPASTCompositeTypeSpecifier.ICPPASTBaseSpecifier))
      {
        ICPPASTCompositeTypeSpecifier.ICPPASTBaseSpecifier superClass = (ICPPASTCompositeTypeSpecifier.ICPPASTBaseSpecifier)astChild;
        if ((superClass.getPropertyInParent().equals(ICPPASTCompositeTypeSpecifier.BASE_SPECIFIER)) && 
          (superClass.getName().toString().compareTo(strSuperClassName) == 0))
        {
          ret = true;
          break;
        }
      }
    }
    return ret;
  }
  
  public static boolean isA(String strSuperClassName, IASTSimpleDeclaration astClassDecl)
  {
    boolean ret = false;
    if ((strSuperClassName == null) || (strSuperClassName.isEmpty()) || (astClassDecl == null)) {
      return ret;
    }
    IASTDeclSpecifier astClassSpecer = astClassDecl.getDeclSpecifier();
    if (!(astClassSpecer instanceof ICPPASTCompositeTypeSpecifier)) {
      return ret;
    }
    if (isA(strSuperClassName, (ICPPASTCompositeTypeSpecifier)astClassSpecer)) {
      ret = true;
    }
    return ret;
  }
  
  public static List<String> findSuperClassList(IASTSimpleDeclaration astClassDecl, List<String> superClassNameList)
  {
    List<String> ret = new ArrayList();
    for (String superClassName : superClassNameList) {
      if (isA(superClassName, astClassDecl)) {
        ret.add(superClassName);
      }
    }
    return ret;
  }
  
  public static ClassInfo findClassDeclarationThatDerivesFrom(List<String> superClassNameList, ITranslationUnit headerUnit)
  {
    ClassInfo ret = null;
    if ((superClassNameList == null) || (superClassNameList.isEmpty()) || 
      (headerUnit == null)) {
      return ret;
    }
    try
    {
      int style = 6;
      IASTTranslationUnit astHeaderUnit = headerUnit.getAST(null, style);
      if (astHeaderUnit == null) {
        return ret;
      }
      List<String> superClassNameListFound = null;
      IASTSimpleDeclaration astClassDecl = null;
      ClassInfo classInfo = null;
      IASTNode[] arrayOfIASTNode;
      int j = (arrayOfIASTNode = astHeaderUnit.getChildren()).length;
      for (int i = 0; i < j; i++)
      {
        IASTNode astChild = arrayOfIASTNode[i];
        if ((astChild instanceof IASTSimpleDeclaration))
        {
          astClassDecl = (IASTSimpleDeclaration)astChild;
          
          superClassNameListFound = findSuperClassList(astClassDecl, superClassNameList);
          if ((superClassNameListFound != null) && (!superClassNameListFound.isEmpty()))
          {
            classInfo = new ClassInfo(astClassDecl);
            classInfo.setSuperClassNameList(superClassNameListFound);
            
            ret = classInfo;
          }
        }
      }
    }
    catch (CoreException e)
    {
      e.printStackTrace();
    }
    return ret;
  }
  
  public static List<ClassInfo> findContainerFactoryClass(List<String> superClassNameList, List<ITranslationUnit> headerUnitList)
  {
    List<ClassInfo> ret = new ArrayList();
    if ((superClassNameList == null) || (superClassNameList.isEmpty()) || 
      (headerUnitList == null) || (headerUnitList.isEmpty())) {
      return ret;
    }
    boolean isFormFactory = false;
    boolean isPanelFactory = false;
    
    ClassInfo classInfo = null;
    for (ITranslationUnit headerUnit : headerUnitList)
    {
      classInfo = findClassDeclarationThatDerivesFrom(superClassNameList, headerUnit);
      if (classInfo != null)
      {
        ret.add(classInfo);
        if (!isFormFactory) {
          isFormFactory = classInfo.isFormFactory();
        }
        if (!isPanelFactory) {
          isPanelFactory = classInfo.isPanelFactory();
        }
        if ((isFormFactory) && (isPanelFactory)) {
          break;
        }
      }
    }
    return ret;
  }
  
  public static List<ClassInfo> findContainerFactoryClass(List<String> superClassNameList, ICProject cProject)
  {
    List<ClassInfo> ret = new ArrayList();
    if ((superClassNameList == null) || (superClassNameList.isEmpty()) || 
      (cProject == null) || (!cProject.exists())) {
      return ret;
    }
    List<ITranslationUnit> headerUnitList = getHeaderUnitList(cProject);
    
    List<ITranslationUnit> expectedHeaderUnitList = new ArrayList();
    List<ITranslationUnit> elseHeaderUnitList = new ArrayList();
    
    String headerFileName = null;
    for (ITranslationUnit headerUnit : headerUnitList)
    {
      headerFileName = headerUnit.getResource().getName();
      if ((headerFileName.endsWith("FormFactory.h")) || 
        (headerFileName.endsWith("PanelFactory.h")) || 
        (headerFileName.compareTo(cProject.getElementName() + ".h") == 0)) {
        expectedHeaderUnitList.add(headerUnit);
      } else {
        elseHeaderUnitList.add(headerUnit);
      }
    }
    ret = findContainerFactoryClass(superClassNameList, expectedHeaderUnitList);
    if ((ret == null) || (ret.size() == 0)) {
      ret = findContainerFactoryClass(superClassNameList, elseHeaderUnitList);
    }
    return ret;
  }
  
  public static List<ClassInfo> findContainerFactoryClass(List<String> superClassNameList, String strProjectName)
  {
    List<ClassInfo> ret = new ArrayList();
    if ((superClassNameList == null) || (superClassNameList.isEmpty()) || 
      (strProjectName == null) || (strProjectName.isEmpty())) {
      return ret;
    }
    ICProject cProject = CoreModel.getDefault().getCModel().getCProject(strProjectName);
    if (!cProject.exists()) {
      return ret;
    }
    ret = findContainerFactoryClass(superClassNameList, cProject);
    
    return ret;
  }
  
  public static String getClassName(IASTSimpleDeclaration astClassDecl)
  {
    if (astClassDecl == null) {
      return null;
    }
    IASTDeclSpecifier astClassSpecer = astClassDecl.getDeclSpecifier();
    if (!(astClassSpecer instanceof ICPPASTCompositeTypeSpecifier)) {
      return null;
    }
    String ret = null;
    IASTNode[] arrayOfIASTNode;
    int j = (arrayOfIASTNode = astClassSpecer.getChildren()).length;
    for (int i = 0; i < j; i++)
    {
      IASTNode astChild = arrayOfIASTNode[i];
      if ((astChild instanceof IASTName))
      {
        IASTName astClassName = (IASTName)astChild;
        ret = astClassName.toString();
        break;
      }
    }
    return ret;
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.uibuilder.codegen.AstHeaderUnitUtil
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.uibuilder.codegen;

import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import org.eclipse.cdt.core.model.CModelException;
import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.core.model.IField;
import org.eclipse.cdt.core.model.IFunction;
import org.eclipse.cdt.core.model.IMethod;
import org.eclipse.cdt.core.model.IMethodDeclaration;
import org.eclipse.cdt.core.model.ISourceRoot;
import org.eclipse.cdt.core.model.IStructure;
import org.eclipse.cdt.core.model.ITranslationUnit;
import org.eclipse.cdt.ui.CDTUITools;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.jface.action.IAction;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.editors.text.TextEditor;
import org.eclipse.ui.ide.IDE;
import org.eclipse.ui.part.FileEditorInput;

public class CDTFileUtil
{
  public static final String HEADER_FOLDER = "INC";
  public static final String SOURCE_FOLDER = "SRC";
  
  public static IFolder getFolder(IProject project, String folder)
  {
    if ((project == null) || (project.getLocation() == null) || 
      (project.getLocation().toFile() == null) || 
      (!project.getLocation().toFile().exists())) {
      return null;
    }
    if ((folder == null) || (folder.isEmpty())) {
      return null;
    }
    try
    {
      IResource[] resources = project.members();
      for (int i = 0; i < resources.length; i++)
      {
        IResource resource = resources[i];
        if (((resource instanceof IFolder)) && (resource.exists()))
        {
          String name = resource.getName();
          if (folder.toUpperCase(Locale.getDefault()).equals(
            name.toUpperCase(Locale.getDefault()))) {
            return project.getFolder(name);
          }
        }
      }
    }
    catch (CoreException e)
    {
      e.printStackTrace();
    }
    return null;
  }
  
  public static ITranslationUnit getCppUnit(IProject project, ITranslationUnit hUnit)
  {
    IFolder srcFolder = getFolder(project, "SRC");
    if ((srcFolder == null) || (!srcFolder.exists())) {
      return null;
    }
    if (hUnit.isHeaderUnit())
    {
      try
      {
        resources = srcFolder.members();
      }
      catch (CoreException e)
      {
        IResource[] resources;
        e.printStackTrace();
        return null;
      }
      IResource[] resources;
      if (resources == null) {
        return null;
      }
      List<IStructure> methodDecls = getCClasses(hUnit);
      if ((methodDecls == null) || (methodDecls.size() <= 0)) {
        return null;
      }
      String className = ((IStructure)methodDecls.get(0)).getElementName();
      IResource[] arrayOfIResource1;
      int j = (arrayOfIResource1 = resources).length;
      for (int i = 0; i < j; i++)
      {
        IResource resource = arrayOfIResource1[i];
        if (resource.exists()) {
          try
          {
            boolean sync = resource.isSynchronized(2);
            if (!sync) {
              resource.refreshLocal(1, null);
            }
            ICElement element = CoreModel.getDefault().create(resource);
            ITranslationUnit translationUnit = null;
            if ((element instanceof ITranslationUnit)) {
              translationUnit = (ITranslationUnit)element;
            }
            if ((translationUnit != null) && (translationUnit.isSourceUnit()))
            {
              List<ICElement> includes = translationUnit
                .getChildrenOfType(75);
              for (ICElement include : includes) {
                if (include.getElementName().equals(
                  hUnit.getElementName()))
                {
                  List<ICElement> methods = getMethods(translationUnit);
                  for (ICElement method : methods)
                  {
                    String name = null;
                    if ((method instanceof IMethod))
                    {
                      IMethod lMethod = (IMethod)method;
                      if (lMethod.isConstructor()) {
                        name = lMethod.getElementName();
                      }
                    }
                    else if ((method instanceof IFunction))
                    {
                      IFunction lFunction = (IFunction)method;
                      name = lFunction.getElementName();
                      if ((name == null) || 
                      
                        (!name.substring(name.lastIndexOf(':') + 1).equals(className))) {
                        name = null;
                      }
                    }
                    if (name != null) {
                      if (name.substring(name.lastIndexOf(':') + 1).equals(className)) {
                        return translationUnit;
                      }
                    }
                  }
                }
              }
            }
          }
          catch (CModelException e)
          {
            e.printStackTrace();
          }
          catch (CoreException e)
          {
            e.printStackTrace();
          }
        }
      }
    }
    return null;
  }
  
  public static List<ICElement> getMethods(ITranslationUnit cppUnit)
  {
    if (cppUnit.isSourceUnit()) {
      try
      {
        List<ICElement> method = cppUnit
          .getChildrenOfType(70);
        List<ICElement> function = cppUnit
          .getChildrenOfType(74);
        for (ICElement element : function) {
          if (!method.contains(element)) {
            method.add(element);
          }
        }
        return method;
      }
      catch (CModelException e)
      {
        e.printStackTrace();
      }
    }
    return new ArrayList();
  }
  
  private static List<IStructure> getCClasses(ITranslationUnit hUnit)
  {
    if (hUnit.isHeaderUnit())
    {
      List<IStructure> cClasses = new ArrayList();
      try
      {
        List<ICElement> classes = hUnit
          .getChildrenOfType(65);
        if (classes == null) {
          return cClasses;
        }
        for (ICElement lClass : classes) {
          if (((lClass instanceof IStructure)) && 
            (!cClasses.contains(lClass))) {
            cClasses.add((IStructure)lClass);
          }
        }
        return cClasses;
      }
      catch (CModelException e)
      {
        e.printStackTrace();
      }
    }
    return null;
  }
  
  private static IStructure getCClass(ITranslationUnit hUnit, String className)
  {
    if (hUnit.isHeaderUnit()) {
      try
      {
        List<ICElement> classes = hUnit
          .getChildrenOfType(65);
        if (classes == null) {
          return null;
        }
        for (ICElement lClass : classes) {
          if (((lClass instanceof IStructure)) && 
            (lClass.getElementName().equals(className))) {
            return (IStructure)lClass;
          }
        }
      }
      catch (CModelException e)
      {
        e.printStackTrace();
      }
    }
    return null;
  }
  
  public static IMethodDeclaration[] getMethodDecls(ITranslationUnit hUnit, String className)
  {
    if (hUnit.isHeaderUnit()) {
      try
      {
        IStructure lClass = getCClass(hUnit, className);
        if (lClass != null) {
          return lClass.getMethods();
        }
      }
      catch (CModelException e)
      {
        e.printStackTrace();
      }
    }
    return new IMethodDeclaration[0];
  }
  
  public static IField[] getFields(ITranslationUnit hUnit, String className)
  {
    if (hUnit.isHeaderUnit()) {
      try
      {
        IStructure lClass = getCClass(hUnit, className);
        if (lClass != null) {
          return lClass.getFields();
        }
      }
      catch (CModelException e)
      {
        e.printStackTrace();
      }
    }
    return new IField[0];
  }
  
  public static ArrayList<String> getSuperClasses(ITranslationUnit hUnit, String className)
  {
    if (hUnit.isHeaderUnit())
    {
      ArrayList<String> superClasses = new ArrayList();
      getRecusiveSuperClasses(hUnit, className, superClasses);
      
      return superClasses;
    }
    return null;
  }
  
  private static void getRecusiveSuperClasses(ITranslationUnit hUnit, String className, ArrayList<String> supers)
  {
    IProject project = hUnit.getResource().getProject();
    
    IStructure lClass = getCClass(hUnit, className);
    if (lClass != null)
    {
      String[] superClasses = lClass.getSuperClassesNames();
      String[] arrayOfString1;
      int j = (arrayOfString1 = superClasses).length;
      for (int i = 0; i < j; i++)
      {
        String superClass = arrayOfString1[i];
        if (!supers.contains(superClass)) {
          supers.add(superClass);
        }
      }
    }
    try
    {
      includes = hUnit.getChildrenOfType(75);
    }
    catch (CModelException e)
    {
      List<ICElement> includes;
      e.printStackTrace(); return;
    }
    List<ICElement> includes;
    IFolder folder = getFolder(project, "INC");
    if ((folder == null) || (!folder.exists())) {
      return;
    }
    for (ICElement include : includes)
    {
      Object resource = folder.getFile(include.getElementName());
      if (((IResource)resource).exists())
      {
        ICElement element = CoreModel.getDefault().create((IResource)resource);
        ITranslationUnit translationUnit = null;
        if ((element instanceof ITranslationUnit)) {
          translationUnit = (ITranslationUnit)element;
        }
        if (translationUnit != null)
        {
          List<IStructure> lClasses = getCClasses(translationUnit);
          for (IStructure structure : lClasses) {
            if ((structure != null) && 
              (supers.contains(structure.getElementName())))
            {
              String[] superClasses = structure.getSuperClassesNames();
              String[] arrayOfString2;
              int m = (arrayOfString2 = superClasses).length;
              for (int k = 0; k < m; k++)
              {
                String superClass = arrayOfString2[k];
                if (!supers.contains(superClass)) {
                  supers.add(superClass);
                }
              }
              getRecusiveSuperClasses(translationUnit, 
                structure.getElementName(), supers);
            }
          }
        }
      }
    }
  }
  
  public static boolean isSuperExist(ITranslationUnit hUnit, String className, String superclass)
  {
    ArrayList<String> superClasses = getSuperClasses(hUnit, className);
    if (superClasses == null) {
      return false;
    }
    for (String lclass : superClasses) {
      if (lclass.equals(superclass)) {
        return true;
      }
    }
    return false;
  }
  
  public static void revealCEditor(IEditorPart editor, int offset, int length)
  {
    if ((editor instanceof TextEditor)) {
      ((TextEditor)editor).selectAndReveal(offset, length);
    }
  }
  
  public static void fomatCEditor(IEditorPart editor)
  {
    if ((editor instanceof TextEditor))
    {
      TextEditor tEditor = (TextEditor)editor;
      IAction formatAction = tEditor.getAction("Format");
      if (formatAction != null) {
        formatAction.run();
      }
    }
  }
  
  public static boolean isOpen(ITranslationUnit unit)
  {
    if (unit == null) {
      return false;
    }
    IResource resource = unit.getResource();
    if (((resource instanceof IFile)) && 
      (findEditor((IFile)resource) != null)) {
      return true;
    }
    return false;
  }
  
  public static IEditorPart findEditor(ITranslationUnit unit)
  {
    if (unit == null) {
      return null;
    }
    IEditorPart editor = null;
    IResource resource = unit.getResource();
    if ((resource instanceof IFile)) {
      editor = findEditor((IFile)resource);
    }
    return editor;
  }
  
  public static IEditorPart findEditor(IFile resource)
  {
    IEditorPart editor = null;
    IWorkbenchPage page = PlatformUI.getWorkbench()
      .getActiveWorkbenchWindow().getActivePage();
    if (page != null) {
      editor = page.findEditor(new FileEditorInput(resource));
    }
    return editor;
  }
  
  public static ITranslationUnit getTranslationUnit(IPath iPath)
  {
    IFile iFile = ResourcesPlugin.getWorkspace().getRoot().getFile(iPath);
    
    ICElement cElement = CoreModel.getDefault().create(iFile);
    if ((cElement instanceof ITranslationUnit)) {
      return (ITranslationUnit)cElement;
    }
    return null;
  }
  
  public static IEditorPart getActiveEditor()
  {
    IEditorPart ret = null;
    
    IWorkbench wb = PlatformUI.getWorkbench();
    
    IWorkbenchWindow wbWin = wb.getActiveWorkbenchWindow();
    if (wbWin == null) {
      return ret;
    }
    IWorkbenchPage wbPage = wbWin.getActivePage();
    if (wbPage == null) {
      return ret;
    }
    ret = wbPage.getActiveEditor();
    
    return ret;
  }
  
  public static ITranslationUnit getTranslationUnit(IEditorPart editor)
  {
    ICElement cElement = CDTUITools.getEditorInputCElement(editor.getEditorInput());
    if ((cElement instanceof ITranslationUnit)) {
      return (ITranslationUnit)cElement;
    }
    return null;
  }
  
  public static List<ITranslationUnit> getTranslationUnitList(ICProject cProject)
  {
    if ((cProject == null) || (!cProject.exists())) {
      return null;
    }
    List<ITranslationUnit> ret = new ArrayList();
    try
    {
      ISourceRoot[] sourceRoots = cProject.getSourceRoots();
      ISourceRoot[] arrayOfISourceRoot1;
      int j = (arrayOfISourceRoot1 = sourceRoots).length;
      for (int i = 0; i < j; i++)
      {
        ISourceRoot sourceRoot = arrayOfISourceRoot1[i];
        List<ICElement> transUnitList = sourceRoot.getChildrenOfType(60);
        for (ICElement transUnit : transUnitList) {
          ret.add((ITranslationUnit)transUnit);
        }
      }
    }
    catch (CModelException e)
    {
      e.printStackTrace();
    }
    catch (UnsupportedOperationException e)
    {
      e.printStackTrace();
    }
    catch (ClassCastException e)
    {
      e.printStackTrace();
    }
    catch (IllegalArgumentException e)
    {
      e.printStackTrace();
    }
    return ret;
  }
  
  public static IEditorPart openEditor(IWorkbenchWindow wbWindow, IFile iFile)
  {
    if (wbWindow == null) {
      return null;
    }
    if ((iFile == null) || (!iFile.exists())) {
      return null;
    }
    IWorkbenchPage wbPage = wbWindow.getActivePage();
    if (wbPage == null) {
      return null;
    }
    IEditorPart editor = null;
    try
    {
      editor = IDE.openEditor(wbPage, iFile);
    }
    catch (PartInitException e)
    {
      e.printStackTrace();
    }
    return editor;
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.uibuilder.codegen.CDTFileUtil
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.uibuilder.codegen;

import java.util.ArrayList;
import java.util.List;
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration;

public class ClassInfo
{
  private IASTSimpleDeclaration astClassDeclaration = null;
  private List<String> superClassNameList = new ArrayList();
  
  ClassInfo(IASTSimpleDeclaration astClassDeclaration)
  {
    setAstClassDeclaration(astClassDeclaration);
  }
  
  public IASTSimpleDeclaration getAstClassDeclaration()
  {
    return astClassDeclaration;
  }
  
  public void setAstClassDeclaration(IASTSimpleDeclaration astClassDeclaration)
  {
    this.astClassDeclaration = astClassDeclaration;
  }
  
  public boolean isFormFactory()
  {
    for (String superClassName : superClassNameList) {
      if (superClassName.compareTo("Tizen::Ui::Scenes::IFormFactory") == 0) {
        return true;
      }
    }
    return false;
  }
  
  public boolean isPanelFactory()
  {
    for (String superClassName : superClassNameList) {
      if (superClassName.compareTo("Tizen::Ui::Scenes::IPanelFactory") == 0) {
        return true;
      }
    }
    return false;
  }
  
  public List<String> getSuperClassNameList()
  {
    return superClassNameList;
  }
  
  public void setSuperClassNameList(List<String> superClassNameList)
  {
    this.superClassNameList = superClassNameList;
  }
  
  public void addSuperClassName(String superClassName)
  {
    superClassNameList.add(superClassName);
  }
  
  public boolean isValid()
  {
    return getAstClassDeclaration() != null;
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.uibuilder.codegen.ClassInfo
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.uibuilder.codegen;

import java.util.ArrayList;
import java.util.List;

public class ContainerFactoryInfo
{
  public static final String HEADER_FILE_SUFFIX_FORMFACTORYH = "FormFactory.h";
  public static final String HEADER_FILE_SUFFIX_PANELFACTORYH = "PanelFactory.h";
  public static final String TYPE_NAME_IFORMFACTORY = "Tizen::Ui::Scenes::IFormFactory";
  public static final String TYPE_NAME_IPANELFACTORY = "Tizen::Ui::Scenes::IPanelFactory";
  private String projectName = null;
  private List<ClassInfo> classInfoList = new ArrayList();
  
  public ContainerFactoryInfo(String projectName)
  {
    this.projectName = projectName;
  }
  
  public boolean update()
  {
    boolean ret = false;
    if ((getProjectName() == null) || (getProjectName().isEmpty())) {
      return ret;
    }
    List<String> superClassNameList = new ArrayList();
    superClassNameList.add("Tizen::Ui::Scenes::IFormFactory");
    superClassNameList.add("Tizen::Ui::Scenes::IPanelFactory");
    
    classInfoList = AstHeaderUnitUtil.findContainerFactoryClass(superClassNameList, getProjectName());
    
    ret = true;
    return ret;
  }
  
  public String getProjectName()
  {
    return projectName;
  }
  
  public List<ClassInfo> getClassInfoList()
  {
    return classInfoList;
  }
  
  public boolean isWorkflowEnable()
  {
    boolean ret = false;
    if ((getClassInfoList() == null) || (getClassInfoList().isEmpty())) {
      return ret;
    }
    for (ClassInfo classInfo : getClassInfoList()) {
      if (classInfo.isFormFactory())
      {
        ret = true;
        break;
      }
    }
    return ret;
  }
  
  public boolean isPanelFactoryEnable()
  {
    boolean ret = false;
    if ((getClassInfoList() == null) || (getClassInfoList().isEmpty())) {
      return ret;
    }
    for (ClassInfo classInfo : getClassInfoList()) {
      if (classInfo.isPanelFactory())
      {
        ret = true;
        break;
      }
    }
    return ret;
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.uibuilder.codegen.ContainerFactoryInfo
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.uibuilder.launcher;

import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;

public class Activator
  extends AbstractUIPlugin
{
  public static final String PLUGIN_ID = "org.tizen.nativecpp.uibuilder.launcher";
  private static Activator plugin;
  
  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;
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.uibuilder.launcher.Activator
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.uibuilder.launcher.common.log;

import java.io.PrintStream;

public class Logger
{
  private static boolean DEBUG_MODE = true;
  public static int DEBUG_TYPE_DID_ENTER = 1;
  public static int DEBUG_TYPE_WILL_LEAVE = 2;
  private static String PREFIX_DEBUG = "[GBP_DEBUG] ";
  private static String PREFIX_ERROR = "[GBP_ERROR] ";
  private static String PREFIX_INFO = "[GBP_INFO] ";
  private static String PREFIX_WARNING = "[GBP_WARNING] ";
  
  private static synchronized void printMessage(String prefix, Object obj, int stackTraceIndex)
  {
    String msg;
    String msg;
    if (DEBUG_MODE)
    {
      StackTraceElement ste = Thread.currentThread().getStackTrace()[stackTraceIndex];
      msg = prefix + ste.getClassName() + "." + ste.getMethodName() + " : (" + ste.getLineNumber() + ") : " + obj;
    }
    else
    {
      msg = prefix + obj;
    }
    System.out.println(msg);
    System.out.flush();
  }
  
  private static void printMessages(String prefix, String title, Object[] objs)
  {
    printMessage(prefix, title, 4);
    for (int j = 0; j < objs.length; j++) {
      printMessage(prefix, "  [" + j + "]" + objs[j], 4);
    }
  }
  
  public static void debug(int debugLogType)
  {
    if (!DEBUG_MODE) {
      return;
    }
    StackTraceElement ste = Thread.currentThread().getStackTrace()[2];
    String msg = "";
    if (!DEBUG_MODE) {
      msg = ste.getClassName() + "." + ste.getMethodName();
    }
    if (debugLogType == DEBUG_TYPE_DID_ENTER) {
      msg = msg + " did enter.";
    } else if (debugLogType == DEBUG_TYPE_WILL_LEAVE) {
      msg = msg + " will leave.";
    }
    printMessage(PREFIX_DEBUG, msg, 3);
  }
  
  public static void debug(Object obj)
  {
    if (!DEBUG_MODE) {
      return;
    }
    printMessage(PREFIX_DEBUG, obj, 3);
  }
  
  public static void debug(String title, Object[] objs)
  {
    printMessages(PREFIX_DEBUG, title, objs);
  }
  
  public static void error(Object obj)
  {
    printMessage(PREFIX_ERROR, obj, 3);
  }
  
  public static void error(Object obj, Exception e)
  {
    printMessage(PREFIX_ERROR, obj, 3);
    e.printStackTrace();
  }
  
  public static void error(String title, Object[] objs)
  {
    printMessages(PREFIX_ERROR, title, objs);
  }
  
  public static void info(Object obj)
  {
    printMessage(PREFIX_INFO, obj, 3);
  }
  
  public static void info(String title, Object[] objs)
  {
    printMessages(PREFIX_INFO, title, objs);
  }
  
  public static void warning(Object obj)
  {
    printMessage(PREFIX_WARNING, obj, 3);
  }
  
  public static void warning(String title, Object[] objs)
  {
    printMessages(PREFIX_WARNING, title, objs);
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.uibuilder.launcher.common.log.Logger
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.uibuilder.launcher.handlers;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.resources.IProject;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ITreeSelection;
import org.eclipse.ui.handlers.HandlerUtil;
import org.tizen.nativecpp.uibuilder.launcher.common.log.Logger;
import org.tizen.nativecpp.uibuilder.launcher.helper.ResourceUtility;
import org.tizen.nativecpp.uibuilder.launcher.loader.UiBuilderLoader;

public class RunUiBuilder
  extends AbstractHandler
{
  public void loadUiBuilder(IProject iProject)
  {
    if ((iProject == null) || (!iProject.exists())) {
      return;
    }
    UiBuilderLoader loader = new UiBuilderLoader(iProject);
    loader.start();
    try
    {
      Thread.sleep(1L);
    }
    catch (InterruptedException e)
    {
      Logger.error(e.getMessage(), e);
    }
  }
  
  public Object execute(ExecutionEvent event)
    throws ExecutionException
  {
    ISelection selection = HandlerUtil.getCurrentSelection(event);
    if ((selection == null) || (selection.isEmpty())) {
      return null;
    }
    if (!(selection instanceof ITreeSelection)) {
      return null;
    }
    ITreeSelection treeSelection = (ITreeSelection)selection;
    IProject selectedProject = ResourceUtility.getIProject(treeSelection);
    
    loadUiBuilder(selectedProject);
    
    return null;
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.uibuilder.launcher.handlers.RunUiBuilder
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.uibuilder.launcher.helper;

import java.util.StringTokenizer;
import org.eclipse.core.runtime.IPath;

public class CommandExecutor
{
  private Runtime runtime;
  private Process process;
  public IPath file;
  
  /* Error */
  public int executeCommand(String[] cmds)
  {
    // Byte code:
    //   0: iconst_m1
    //   1: istore_2
    //   2: aload_1
    //   3: arraylength
    //   4: ifne +8 -> 12
    //   7: iconst_m1
    //   8: istore_2
    //   9: goto +174 -> 183
    //   12: aload_0
    //   13: invokestatic 22	java/lang/Runtime:getRuntime	()Ljava/lang/Runtime;
    //   16: putfield 28	org/tizen/nativecpp/uibuilder/launcher/helper/CommandExecutor:runtime	Ljava/lang/Runtime;
    //   19: aload_0
    //   20: aload_0
    //   21: getfield 28	org/tizen/nativecpp/uibuilder/launcher/helper/CommandExecutor:runtime	Ljava/lang/Runtime;
    //   24: aload_1
    //   25: invokevirtual 30	java/lang/Runtime:exec	([Ljava/lang/String;)Ljava/lang/Process;
    //   28: putfield 34	org/tizen/nativecpp/uibuilder/launcher/helper/CommandExecutor:process	Ljava/lang/Process;
    //   31: aload_0
    //   32: getfield 34	org/tizen/nativecpp/uibuilder/launcher/helper/CommandExecutor:process	Ljava/lang/Process;
    //   35: ifnull +148 -> 183
    //   38: new 36	org/tizen/nativecpp/uibuilder/launcher/helper/ThreadOutput
    //   41: dup
    //   42: aload_0
    //   43: getfield 34	org/tizen/nativecpp/uibuilder/launcher/helper/CommandExecutor:process	Ljava/lang/Process;
    //   46: invokevirtual 38	java/lang/Process:getInputStream	()Ljava/io/InputStream;
    //   49: invokespecial 44	org/tizen/nativecpp/uibuilder/launcher/helper/ThreadOutput:<init>	(Ljava/io/InputStream;)V
    //   52: astore_3
    //   53: new 36	org/tizen/nativecpp/uibuilder/launcher/helper/ThreadOutput
    //   56: dup
    //   57: aload_0
    //   58: getfield 34	org/tizen/nativecpp/uibuilder/launcher/helper/CommandExecutor:process	Ljava/lang/Process;
    //   61: invokevirtual 47	java/lang/Process:getErrorStream	()Ljava/io/InputStream;
    //   64: invokespecial 44	org/tizen/nativecpp/uibuilder/launcher/helper/ThreadOutput:<init>	(Ljava/io/InputStream;)V
    //   67: astore 4
    //   69: aload_3
    //   70: invokevirtual 50	org/tizen/nativecpp/uibuilder/launcher/helper/ThreadOutput:start	()V
    //   73: aload 4
    //   75: invokevirtual 50	org/tizen/nativecpp/uibuilder/launcher/helper/ThreadOutput:start	()V
    //   78: aload_0
    //   79: getfield 34	org/tizen/nativecpp/uibuilder/launcher/helper/CommandExecutor:process	Ljava/lang/Process;
    //   82: invokevirtual 53	java/lang/Process:waitFor	()I
    //   85: pop
    //   86: aload_0
    //   87: getfield 34	org/tizen/nativecpp/uibuilder/launcher/helper/CommandExecutor:process	Ljava/lang/Process;
    //   90: invokevirtual 57	java/lang/Process:exitValue	()I
    //   93: istore_2
    //   94: aload_3
    //   95: invokevirtual 60	org/tizen/nativecpp/uibuilder/launcher/helper/ThreadOutput:isAlive	()Z
    //   98: ifne -4 -> 94
    //   101: aload 4
    //   103: invokevirtual 60	org/tizen/nativecpp/uibuilder/launcher/helper/ThreadOutput:isAlive	()Z
    //   106: ifne -12 -> 94
    //   109: goto +74 -> 183
    //   112: astore_3
    //   113: aload_3
    //   114: invokevirtual 64	java/io/IOException:getMessage	()Ljava/lang/String;
    //   117: aload_3
    //   118: invokestatic 70	org/tizen/nativecpp/uibuilder/launcher/common/log/Logger:error	(Ljava/lang/Object;Ljava/lang/Exception;)V
    //   121: aload_0
    //   122: getfield 34	org/tizen/nativecpp/uibuilder/launcher/helper/CommandExecutor:process	Ljava/lang/Process;
    //   125: ifnull +72 -> 197
    //   128: aload_0
    //   129: getfield 34	org/tizen/nativecpp/uibuilder/launcher/helper/CommandExecutor:process	Ljava/lang/Process;
    //   132: invokevirtual 76	java/lang/Process:destroy	()V
    //   135: goto +62 -> 197
    //   138: astore_3
    //   139: aload_3
    //   140: invokevirtual 79	java/lang/InterruptedException:getMessage	()Ljava/lang/String;
    //   143: aload_3
    //   144: invokestatic 70	org/tizen/nativecpp/uibuilder/launcher/common/log/Logger:error	(Ljava/lang/Object;Ljava/lang/Exception;)V
    //   147: aload_0
    //   148: getfield 34	org/tizen/nativecpp/uibuilder/launcher/helper/CommandExecutor:process	Ljava/lang/Process;
    //   151: ifnull +46 -> 197
    //   154: aload_0
    //   155: getfield 34	org/tizen/nativecpp/uibuilder/launcher/helper/CommandExecutor:process	Ljava/lang/Process;
    //   158: invokevirtual 76	java/lang/Process:destroy	()V
    //   161: goto +36 -> 197
    //   164: astore 5
    //   166: aload_0
    //   167: getfield 34	org/tizen/nativecpp/uibuilder/launcher/helper/CommandExecutor:process	Ljava/lang/Process;
    //   170: ifnull +10 -> 180
    //   173: aload_0
    //   174: getfield 34	org/tizen/nativecpp/uibuilder/launcher/helper/CommandExecutor:process	Ljava/lang/Process;
    //   177: invokevirtual 76	java/lang/Process:destroy	()V
    //   180: aload 5
    //   182: athrow
    //   183: aload_0
    //   184: getfield 34	org/tizen/nativecpp/uibuilder/launcher/helper/CommandExecutor:process	Ljava/lang/Process;
    //   187: ifnull +10 -> 197
    //   190: aload_0
    //   191: getfield 34	org/tizen/nativecpp/uibuilder/launcher/helper/CommandExecutor:process	Ljava/lang/Process;
    //   194: invokevirtual 76	java/lang/Process:destroy	()V
    //   197: iload_2
    //   198: ireturn
    // Line number table:
    //   Java source line #44	-> byte code offset #0
    //   Java source line #48	-> byte code offset #2
    //   Java source line #49	-> byte code offset #7
    //   Java source line #51	-> byte code offset #12
    //   Java source line #52	-> byte code offset #19
    //   Java source line #54	-> byte code offset #31
    //   Java source line #55	-> byte code offset #38
    //   Java source line #56	-> byte code offset #53
    //   Java source line #57	-> byte code offset #69
    //   Java source line #58	-> byte code offset #73
    //   Java source line #60	-> byte code offset #78
    //   Java source line #62	-> byte code offset #86
    //   Java source line #64	-> byte code offset #94
    //   Java source line #65	-> byte code offset #109
    //   Java source line #70	-> byte code offset #112
    //   Java source line #71	-> byte code offset #113
    //   Java source line #75	-> byte code offset #121
    //   Java source line #76	-> byte code offset #128
    //   Java source line #72	-> byte code offset #138
    //   Java source line #73	-> byte code offset #139
    //   Java source line #75	-> byte code offset #147
    //   Java source line #76	-> byte code offset #154
    //   Java source line #74	-> byte code offset #164
    //   Java source line #75	-> byte code offset #166
    //   Java source line #76	-> byte code offset #173
    //   Java source line #78	-> byte code offset #180
    //   Java source line #75	-> byte code offset #183
    //   Java source line #76	-> byte code offset #190
    //   Java source line #79	-> byte code offset #197
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	199	0	this	CommandExecutor
    //   0	199	1	cmds	String[]
    //   1	197	2	retValue	int
    //   52	43	3	gboInput	ThreadOutput
    //   112	6	3	e	java.io.IOException
    //   138	6	3	e	InterruptedException
 
1 2 3 4

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