org.tizen.nativecpp.setting_1.0.0.201311042022

16:50:18.537 INFO  jd.cli.Main - Decompiling org.tizen.nativecpp.setting_1.0.0.201311042022.jar
package org.tizen.nativecpp.setting;

import java.util.HashMap;
import java.util.Map;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.text.IDocument;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;

public class SettingPlugin
  extends AbstractUIPlugin
{
  public static final String PLUGIN_ID = "org.tizen.nativecpp.setting";
  public static final String MARKER_ID = "org.tizen.setting.problemMarker";
  private static SettingPlugin 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 SettingPlugin getDefault()
  {
    return plugin;
  }
  
  public static ImageDescriptor getImageDescriptor(String path)
  {
    return imageDescriptorFromPlugin("org.tizen.nativecpp.setting", path);
  }
  
  public static void setErrorMessage(String location, String message, Exception e)
  {
    getDefault().getLog().log(new Status(4, location, message));
  }
  
  public static IMarker makeMarker(IFile file, IDocument document, int lineNumber, String errorMessage)
  {
    String lineNumberString = "line " + lineNumber;
    
    Map<String, Object> map = new HashMap();
    map.put("message", errorMessage);
    map.put("location", lineNumberString);
    map.put("severity", Integer.valueOf(2));
    map.put("lineNumber", Integer.valueOf(lineNumber));
    
    IMarker marker = null;
    try
    {
      marker = file.createMarker("org.tizen.setting.problemMarker");
      marker.setAttributes(map);
    }
    catch (CoreException e)
    {
      setErrorMessage("MakeMarker() : Failed createMarker", e.getMessage(), e);
    }
    return marker;
  }
  
  public static boolean deleteMarkers(IProject project)
  {
    try
    {
      project.deleteMarkers("org.tizen.setting.problemMarker", false, 2);
      return true;
    }
    catch (CoreException e)
    {
      setErrorMessage("DeleteMarker()", e.getMessage(), e);
    }
    return false;
  }
  
  public static boolean deleteMarkers(IResource resource)
  {
    try
    {
      resource.deleteMarkers("org.tizen.setting.problemMarker", false, 2);
      return true;
    }
    catch (CoreException e)
    {
      setErrorMessage("DeleteMarker()", e.getMessage(), e);
    }
    return false;
  }
}

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

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.tizen.nativecommon.launch.LaunchInfo;
import org.tizen.nativecommon.launch.LaunchListener;

class StartUp$1
  implements LaunchListener
{
  StartUp$1(StartUp paramStartUp) {}
  
  public void preLaunched(LaunchInfo info)
    throws CoreException
  {
    if (!info.isRdsMode()) {
      return;
    }
    IProject project = info.getProject();
    if (project == null) {
      return;
    }
    IFile settingXmlFile = StartUp.access$0(this$0, project);
    if (settingXmlFile == null) {
      return;
    }
    StartUp.access$1(this$0, settingXmlFile);
  }
  
  public void postLaunched(LaunchInfo info)
    throws CoreException
  {}
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.setting.StartUp.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.setting;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.tizen.nativecommon.build.PackageInfo;
import org.tizen.nativecommon.build.PackageListener;

class StartUp$2
  implements PackageListener
{
  StartUp$2(StartUp paramStartUp) {}
  
  public void preCreated(PackageInfo info)
    throws CoreException
  {
    IProject project = info.getProject();
    if (project == null) {
      return;
    }
    IFile settingXmlFile = StartUp.access$0(this$0, project);
    if (settingXmlFile == null) {
      return;
    }
    StartUp.access$1(this$0, settingXmlFile);
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.setting.StartUp.2
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.setting;

import java.io.IOException;
import java.io.InputStream;
import java.io.StringReader;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.text.Document;
import org.eclipse.jface.text.IDocument;
import org.eclipse.ui.IStartup;
import org.tizen.nativecommon.build.CommonProjectDependentPackager;
import org.tizen.nativecommon.build.PackageInfo;
import org.tizen.nativecommon.build.PackageListener;
import org.tizen.nativecommon.launch.AbstractTizenCLaunchDelegate;
import org.tizen.nativecommon.launch.LaunchInfo;
import org.tizen.nativecommon.launch.LaunchListener;
import org.tizen.nativecpp.build.NativeProjectDependentPackager;
import org.tizen.nativecpp.misc.core.NewAppXmlStore;
import org.tizen.nativecpp.misc.core.TizenManifestModel;
import org.tizen.nativecpp.setting.model.XMLErrorHandler;
import org.tizen.nativecpp.setting.validation.XMLContentsHandler;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.XMLReaderFactory;

public class StartUp
  implements IStartup
{
  public void earlyStartup()
  {
    AbstractTizenCLaunchDelegate.addListener(new LaunchListener()
    {
      public void preLaunched(LaunchInfo info)
        throws CoreException
      {
        if (!info.isRdsMode()) {
          return;
        }
        IProject project = info.getProject();
        if (project == null) {
          return;
        }
        IFile settingXmlFile = StartUp.this.getSettingFile(project);
        if (settingXmlFile == null) {
          return;
        }
        StartUp.this.checkValidation(settingXmlFile);
      }
      
      public void postLaunched(LaunchInfo info)
        throws CoreException
      {}
    });
    NativeProjectDependentPackager.getInstance().addListener(new PackageListener()
    {
      public void preCreated(PackageInfo info)
        throws CoreException
      {
        IProject project = info.getProject();
        if (project == null) {
          return;
        }
        IFile settingXmlFile = StartUp.this.getSettingFile(project);
        if (settingXmlFile == null) {
          return;
        }
        StartUp.this.checkValidation(settingXmlFile);
      }
    });
  }
  
  private void checkValidation(IFile file)
    throws CoreException
  {
    SettingPlugin.deleteMarkers(file);
    IDocument doc = new Document(iFile2String(file));
    
    XMLContentsHandler contentsHandler = new XMLContentsHandler(file, doc);
    XMLErrorHandler errorHandler = new XMLErrorHandler(file, doc);
    if (doc != null) {
      try
      {
        XMLReader xmlReader = XMLReaderFactory.createXMLReader();
        xmlReader.setContentHandler(contentsHandler);
        xmlReader.setErrorHandler(errorHandler);
        StringReader sr = new StringReader(doc.get());
        InputSource is = new InputSource(sr);
        xmlReader.parse(is);
      }
      catch (SAXException e)
      {
        e.printStackTrace();
      }
      catch (IOException e)
      {
        e.printStackTrace();
      }
    }
    contentsHandler.isContainError();
    errorHandler.isContainError();
  }
  
  private String iFile2String(IFile file)
  {
    InputStream inputStream = null;
    StringBuffer sb = new StringBuffer();
    try
    {
      inputStream = file.getContents();
      byte[] b = new byte['?'];
      int i;
      while ((i = inputStream.read(b)) != -1)
      {
        int i;
        sb.append(new String(b, 0, i));
      }
    }
    catch (CoreException e)
    {
      e.printStackTrace();
    }
    catch (IOException e)
    {
      e.printStackTrace();
    }
    return sb.toString();
  }
  
  private IFile getSettingFile(IProject project)
  {
    IFolder settingFolder = project.getFolder("setting");
    if (!settingFolder.exists()) {
      return null;
    }
    NewAppXmlStore newAppXmlStore = new NewAppXmlStore(project);
    newAppXmlStore.loadXml();
    
    String fileName = "setting." + newAppXmlStore.getModel().getVersion() + ".xml";
    
    IFile settingXmlFile = settingFolder.getFile(fileName);
    if (!settingXmlFile.exists()) {
      return null;
    }
    return settingXmlFile;
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.setting.StartUp
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.setting.action;

import java.util.ArrayList;
import java.util.List;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
import org.tizen.nativecpp.setting.SettingPlugin;
import org.tizen.nativecpp.setting.dialog.AddSettingElementDialog;
import org.tizen.nativecpp.setting.editors.MultiPageEditor;
import org.tizen.nativecpp.setting.model.ElementType;
import org.tizen.nativecpp.setting.model.SettingModel;
import org.tizen.nativecpp.setting.settingPage.SettingPage;

public class AddSettingElementAction
  extends Action
{
  private MultiPageEditor fMultiPageEditor;
  private SettingPage fSettingPage;
  
  public AddSettingElementAction(MultiPageEditor multiPageEditor, SettingPage settingPage)
  {
    fMultiPageEditor = multiPageEditor;
    fSettingPage = settingPage;
    super.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor("IMG_OBJ_ADD"));
    super.setToolTipText("Add Element");
  }
  
  public void run()
  {
    List<String> list = new ArrayList();
    
    Shell shell = fMultiPageEditor.getEditorSite().getShell();
    if (fSettingPage.getSettingModel().getTreeList().size() > 0)
    {
      String[] label = { "OK" };
      MessageDialog messageDialog = new MessageDialog(shell, "Information", null, "You cannot add another <setting> element, since only 1 <setting> element is allowed.", 2, label, 0);
      messageDialog.open();
      return;
    }
    AddSettingElementDialog dialog = new AddSettingElementDialog(shell, fSettingPage.getSettingModel().getIdList());
    if (dialog.open() != 0) {
      return;
    }
    String id = dialog.getId();
    String title = dialog.getTitle();
    String main = dialog.getMain();
    if ((id.length() <= 0) || (title.length() <= 0) || (main.length() <= 0))
    {
      SettingPlugin.setErrorMessage("AddSettingElementListener", "Value is missing.", null);
      return;
    }
    list.add(id);
    list.add(main);
    list.add(title);
    
    fSettingPage.addOperation(null, list, ElementType.setting, ElementType.settings);
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.setting.action.AddSettingElementAction
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.setting.action;

import java.util.List;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPartSite;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.tizen.nativecpp.setting.model.SettingModel;
import org.tizen.nativecpp.setting.model.TreeNode;
import org.tizen.nativecpp.setting.settingPage.SettingPage;

public class RemoveElementAction
  extends Action
{
  private SettingPage fSettingPage;
  
  public RemoveElementAction(SettingPage settingPage)
  {
    fSettingPage = settingPage;
    super.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor("IMG_TOOL_DELETE"));
    super.setToolTipText("Remove Selected Element");
  }
  
  public void run()
  {
    ISelection selection = fSettingPage.getSelection();
    if (!(selection instanceof IStructuredSelection)) {
      return;
    }
    Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().getSite().getShell();
    if (fSettingPage.getSettingModel().getTreeList().size() == 1)
    {
      String[] label = { "OK" };
      MessageDialog messageDialog = new MessageDialog(shell, "Information", null, "You cannot remove the <setting> element, since it is a mandatory element.", 2, label, 0);
      messageDialog.open();
      return;
    }
    if ((((IStructuredSelection)selection).getFirstElement() instanceof TreeNode))
    {
      TreeNode treeNode = (TreeNode)((IStructuredSelection)selection).getFirstElement();
      fSettingPage.removeOperation(treeNode);
    }
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.setting.action.RemoveElementAction
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.setting.dialog;

import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;

class AddExpandItemDialog$1
  implements ModifyListener
{
  AddExpandItemDialog$1(AddExpandItemDialog paramAddExpandItemDialog) {}
  
  public void modifyText(ModifyEvent e)
  {
    AddExpandItemDialog.access$0(this$0);
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.setting.dialog.AddExpandItemDialog.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.setting.dialog;

import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;

class AddExpandItemDialog$2
  implements ModifyListener
{
  AddExpandItemDialog$2(AddExpandItemDialog paramAddExpandItemDialog) {}
  
  public void modifyText(ModifyEvent e)
  {
    AddExpandItemDialog.access$1(this$0);
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.setting.dialog.AddExpandItemDialog.2
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.setting.dialog;

import java.util.List;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.resource.FontRegistry;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.tizen.nativecpp.setting.model.ElementType;
import org.tizen.nativecpp.setting.util.ElementUtil;
import org.tizen.nativecpp.setting.util.ValueValidation;

public class AddExpandItemDialog
  extends Dialog
{
  private String id;
  private String title;
  private Text idField;
  private Text titleField;
  private Button okButton;
  private Label errorMessageLabel;
  private Label errorMessageIcon;
  private List<String> idList;
  private List<String> titleList;
  private String[] errorList = new String[2];
  private final String DIALOG_TITLE = "Adding ExpandItem";
  private final int WIDTH = 280;
  private final int VERTICAL_SPAN = 10;
  
  public AddExpandItemDialog(Shell parentShell, List<String> idlist, List<String> titleList)
  {
    super(parentShell);
    setShellStyle(2144);
    idList = idlist;
    this.titleList = titleList;
  }
  
  protected void buttonPressed(int buttonId)
  {
    if (buttonId == 0)
    {
      for (int i = 0; i < 2; i++) {
        if (errorList[i] != null)
        {
          setErrorMessage(errorList[i], ElementUtil.ERROR_IMG);
          okButton.setEnabled(false);
          return;
        }
      }
      id = idField.getText().trim();
      title = titleField.getText().trim();
      
      String errorMessage = null;
      if (id.length() <= 0) {
        errorMessage = "The ID must not be empty.";
      } else if (title.length() <= 0) {
        errorMessage = "The Title  must not be empty.";
      }
      if (errorMessage != null)
      {
        setErrorMessage(errorMessage, ElementUtil.ERROR_IMG);
        okButton.setEnabled(false);
      }
      else
      {
        super.buttonPressed(buttonId);
      }
    }
    else
    {
      super.buttonPressed(buttonId);
    }
  }
  
  protected void createButtonsForButtonBar(Composite parent)
  {
    okButton = createButton(parent, 0, IDialogConstants.OK_LABEL, true);
    createButton(parent, 1, IDialogConstants.CANCEL_LABEL, false);
  }
  
  protected Control createDialogArea(Composite parent)
  {
    Composite container = (Composite)super.createDialogArea(parent);
    GridLayout gridLayout = new GridLayout();
    numColumns = 2;
    container.setLayout(gridLayout);
    
    Label idLabel = new Label(container, 0);
    idLabel.setLayoutData(new GridData(3, 
      2, false, false));
    idLabel.setText("Id:");
    
    idField = new Text(container, 2048);
    idField.setLayoutData(new GridData(4, 
      2, true, false));
    
    Label titleLabel = new Label(container, 0);
    titleLabel.setLayoutData(new GridData(3, 2, 
      false, false));
    titleLabel.setText("Title:");
    
    titleField = new Text(container, 2048);
    titleField.setLayoutData(new GridData(4, 
      2, true, false));
    
    errorMessageIcon = new Label(container, 0);
    GridData gd = new GridData(3, 2, false, false);
    verticalSpan = 10;
    
    errorMessageIcon.setLayoutData(gd);
    errorMessageIcon.setImage(null);
    
    errorMessageLabel = new Label(container, 64);
    errorMessageLabel.setText("");
    
    gd = new GridData(4, 2, false, false);
    verticalSpan = 10;
    widthHint = 280;
    
    errorMessageLabel.setLayoutData(gd);
    errorMessageLabel.setFont(JFaceResources.getFontRegistry().get("org.eclipse.jface.bannerfont"));
    Color color = new Color(errorMessageLabel.getDisplay(), 200, 0, 0);
    errorMessageLabel.setForeground(color);
    
    initContent();
    
    return container;
  }
  
  private void initContent()
  {
    idField.addModifyListener(new ModifyListener()
    {
      public void modifyText(ModifyEvent e)
      {
        AddExpandItemDialog.this.updateIDErrorMessage();
      }
    });
    titleField.addModifyListener(new ModifyListener()
    {
      public void modifyText(ModifyEvent e)
      {
        AddExpandItemDialog.this.updateTitleErrorMessage();
      }
    });
  }
  
  private void updateIDErrorMessage()
  {
    String errorMessage = null;
    String id = idField.getText();
    if (id.length() > 0)
    {
      errorMessage = ValueValidation.checkIDformat(id, ElementType.expanditem);
      if (errorMessage == null) {
        errorMessage = ValueValidation.checkString(id);
      }
      if (errorMessage == null) {
        errorMessage = ValueValidation.checkDuplicate(id, idList, null);
      }
      errorList[0] = errorMessage;
    }
    if (errorMessage != null)
    {
      setErrorMessage(errorMessage, ElementUtil.ERROR_IMG);
      okButton.setEnabled(false);
    }
    else if (errorList[1] != null)
    {
      setErrorMessage(errorList[1], ElementUtil.ERROR_IMG);
      okButton.setEnabled(false);
    }
    else
    {
      setErrorMessage("", null);
      okButton.setEnabled(true);
    }
  }
  
  private void updateTitleErrorMessage()
  {
    String errorMessage = null;
    String title = titleField.getText();
    if (title.length() > 0)
    {
      errorMessage = ValueValidation.checkString(title);
      if (errorMessage == null) {
        errorMessage = ValueValidation.checkDuplicate(title, titleList, ElementType.expanditem);
      }
      errorList[1] = errorMessage;
    }
    if (errorMessage != null)
    {
      setErrorMessage(errorMessage, ElementUtil.ERROR_IMG);
      okButton.setEnabled(false);
    }
    else if (errorList[0] != null)
    {
      setErrorMessage(errorList[0], ElementUtil.ERROR_IMG);
      okButton.setEnabled(false);
    }
    else
    {
      setErrorMessage("", null);
      okButton.setEnabled(true);
    }
  }
  
  private void setErrorMessage(String errorMessage, Image image)
  {
    errorMessageLabel.setText(errorMessage);
    errorMessageIcon.setImage(image);
    errorMessageLabel.getParent().layout();
  }
  
  protected void configureShell(Shell newShell)
  {
    super.configureShell(newShell);
    newShell.setText("Adding ExpandItem");
  }
  
  protected boolean isResizable()
  {
    return true;
  }
  
  public String getId()
  {
    return id;
  }
  
  public String getTitle()
  {
    return title;
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.setting.dialog.AddExpandItemDialog
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.setting.dialog;

import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;

class AddGroupChildElementDialog$1
  implements ModifyListener
{
  AddGroupChildElementDialog$1(AddGroupChildElementDialog paramAddGroupChildElementDialog) {}
  
  public void modifyText(ModifyEvent e)
  {
    AddGroupChildElementDialog.access$37(this$0);
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.setting.dialog.AddGroupChildElementDialog.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.setting.dialog;

import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;

class AddGroupChildElementDialog$2
  implements ModifyListener
{
  AddGroupChildElementDialog$2(AddGroupChildElementDialog paramAddGroupChildElementDialog) {}
  
  public void modifyText(ModifyEvent e)
  {
    AddGroupChildElementDialog.access$38(this$0);
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.setting.dialog.AddGroupChildElementDialog.2
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.setting.dialog;

import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;

class AddGroupChildElementDialog$3
  implements ModifyListener
{
  AddGroupChildElementDialog$3(AddGroupChildElementDialog paramAddGroupChildElementDialog) {}
  
  public void modifyText(ModifyEvent e)
  {
    AddGroupChildElementDialog.access$39(this$0);
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.setting.dialog.AddGroupChildElementDialog.3
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.setting.dialog;

import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;

class AddGroupChildElementDialog$4
  implements ModifyListener
{
  AddGroupChildElementDialog$4(AddGroupChildElementDialog paramAddGroupChildElementDialog) {}
  
  public void modifyText(ModifyEvent e)
  {
    AddGroupChildElementDialog.access$40(this$0);
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.setting.dialog.AddGroupChildElementDialog.4
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.setting.dialog;

import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;

class AddGroupChildElementDialog$5
  implements ModifyListener
{
  AddGroupChildElementDialog$5(AddGroupChildElementDialog paramAddGroupChildElementDialog) {}
  
  public void modifyText(ModifyEvent e)
  {
    AddGroupChildElementDialog.access$41(this$0);
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.setting.dialog.AddGroupChildElementDialog.5
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.setting.dialog;

import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.tizen.nativecpp.setting.util.ElementUtil;

class AddGroupChildElementDialog$TypeSelectionListener
  implements SelectionListener
{
  private AddGroupChildElementDialog$TypeSelectionListener(AddGroupChildElementDialog paramAddGroupChildElementDialog) {}
  
  public void widgetSelected(SelectionEvent e)
  {
    AddGroupChildElementDialog.access$1(this$0, AddGroupChildElementDialog.access$0(this$0).getText());
    AddGroupChildElementDialog.access$3(this$0, ElementUtil.checkType(AddGroupChildElementDialog.access$2(this$0)));
    if (AddGroupChildElementDialog.access$2(this$0).equals("expandlist"))
    {
      Shell shell = this$0.getShell();
      if (AddGroupChildElementDialog.access$4(this$0) == null) {
        AddGroupChildElementDialog.access$5(this$0, shell.getSize());
      }
      AddGroupChildElementDialog.access$6(this$0, true, true, true, true);
      if (AddGroupChildElementDialog.access$7(this$0) == null) {
        AddGroupChildElementDialog.access$9(this$0, AddGroupChildElementDialog.access$8(this$0).getSize());
      }
      AddGroupChildElementDialog.access$10(this$0);
      AddGroupChildElementDialog.access$11(this$0);
      
      AddGroupChildElementDialog.access$12(this$0).moveBelow(AddGroupChildElementDialog.access$13(this$0));
      AddGroupChildElementDialog.access$14(this$0).moveBelow(AddGroupChildElementDialog.access$12(this$0));
      
      Point size = new Point(access$4this$0).x, access$4this$0).y - 
        2 * access$7this$0).y);
      
      AddGroupChildElementDialog.access$15(this$0).layout();
      
      shell = this$0.getShell();
      shell.setSize(size);
    }
    else if (AddGroupChildElementDialog.access$2(this$0).equals("integer"))
    {
      Shell shell = this$0.getShell();
      
      AddGroupChildElementDialog.access$6(this$0, false, true, false, true);
      if (AddGroupChildElementDialog.access$4(this$0) == null) {
        AddGroupChildElementDialog.access$5(this$0, shell.getSize());
      }
      if ((AddGroupChildElementDialog.access$16(this$0).isDisposed()) && (AddGroupChildElementDialog.access$17(this$0).isDisposed())) {
        AddGroupChildElementDialog.access$18(this$0);
      }
      if ((AddGroupChildElementDialog.access$19(this$0).isDisposed()) && (AddGroupChildElementDialog.access$20(this$0).isDisposed())) {
        AddGroupChildElementDialog.access$21(this$0);
      }
      if ((AddGroupChildElementDialog.access$22(this$0).isDisposed()) && (AddGroupChildElementDialog.access$23(this$0).isDisposed())) {
        AddGroupChildElementDialog.access$24(this$0);
      }
      AddGroupChildElementDialog.access$17(this$0).setText("Min:");
      AddGroupChildElementDialog.access$20(this$0).setText("Max:");
      
      AddGroupChildElementDialog.access$23(this$0).moveBelow(AddGroupChildElementDialog.access$19(this$0));
      AddGroupChildElementDialog.access$22(this$0).moveBelow(AddGroupChildElementDialog.access$23(this$0));
      
      AddGroupChildElementDialog.access$10(this$0);
      AddGroupChildElementDialog.access$11(this$0);
      
      AddGroupChildElementDialog.access$12(this$0).moveBelow(AddGroupChildElementDialog.access$22(this$0));
      AddGroupChildElementDialog.access$14(this$0).moveBelow(AddGroupChildElementDialog.access$12(this$0));
      
      AddGroupChildElementDialog.access$15(this$0).layout();
      shell.setSize(AddGroupChildElementDialog.access$4(this$0));
    }
    else if (AddGroupChildElementDialog.access$2(this$0).equals("string"))
    {
      Shell shell = this$0.getShell();
      
      AddGroupChildElementDialog.access$6(this$0, false, true, false, true);
      if (AddGroupChildElementDialog.access$4(this$0) == null) {
        AddGroupChildElementDialog.access$5(this$0, shell.getSize());
      }
      if ((AddGroupChildElementDialog.access$16(this$0).isDisposed()) && (AddGroupChildElementDialog.access$17(this$0).isDisposed())) {
        AddGroupChildElementDialog.access$18(this$0);
      }
      if ((AddGroupChildElementDialog.access$19(this$0).isDisposed()) && (AddGroupChildElementDialog.access$20(this$0).isDisposed())) {
        AddGroupChildElementDialog.access$21(this$0);
      }
      if ((AddGroupChildElementDialog.access$22(this$0).isDisposed()) && (AddGroupChildElementDialog.access$23(this$0).isDisposed())) {
        AddGroupChildElementDialog.access$24(this$0);
      }
      AddGroupChildElementDialog.access$17(this$0).setText("MinLength:");
      AddGroupChildElementDialog.access$20(this$0).setText("MaxLength:");
      
      AddGroupChildElementDialog.access$23(this$0).moveBelow(AddGroupChildElementDialog.access$19(this$0));
      AddGroupChildElementDialog.access$22(this$0).moveBelow(AddGroupChildElementDialog.access$23(this$0));
      
      AddGroupChildElementDialog.access$10(this$0);
      AddGroupChildElementDialog.access$11(this$0);
      
      AddGroupChildElementDialog.access$12(this$0).moveBelow(AddGroupChildElementDialog.access$22(this$0));
      AddGroupChildElementDialog.access$14(this$0).moveBelow(AddGroupChildElementDialog.access$12(this$0));
      
      AddGroupChildElementDialog.access$15(this$0).layout();
      
      Point size = new Point(access$4this$0).x + (access$17this$0).getSize().x - access$23this$0).getSize().x), access$4this$0).y);
      
      shell.setSize(size);
    }
    else if (AddGroupChildElementDialog.access$2(this$0).equals("bool"))
    {
      Shell shell = this$0.getShell();
      if (AddGroupChildElementDialog.access$4(this$0) == null) {
        AddGroupChildElementDialog.access$5(this$0, shell.getSize());
      }
      AddGroupChildElementDialog.access$6(this$0, true, false, true, true);
      if (AddGroupChildElementDialog.access$7(this$0) == null) {
        AddGroupChildElementDialog.access$9(this$0, AddGroupChildElementDialog.access$8(this$0).getSize());
      }
      if ((AddGroupChildElementDialog.access$25(this$0) == null) || ((AddGroupChildElementDialog.access$25(this$0).isDisposed()) && (AddGroupChildElementDialog.access$26(this$0).isDisposed()))) {
        AddGroupChildElementDialog.access$27(this$0);
      }
      AddGroupChildElementDialog.access$10(this$0);
      AddGroupChildElementDialog.access$11(this$0);
      
      AddGroupChildElementDialog.access$12(this$0).moveBelow(AddGroupChildElementDialog.access$25(this$0));
      AddGroupChildElementDialog.access$14(this$0).moveBelow(AddGroupChildElementDialog.access$12(this$0));
      
      Point size = new Point(access$4this$0).x, access$4this$0).y - 
        2 * access$7this$0).y);
      
      AddGroupChildElementDialog.access$15(this$0).layout();
      
      shell = this$0.getShell();
      shell.setSize(size);
    }
    else if (AddGroupChildElementDialog.access$2(this$0).equals("launch"))
    {
      Shell shell = this$0.getShell();
      if (AddGroupChildElementDialog.access$4(this$0) == null) {
        AddGroupChildElementDialog.access$5(this$0, shell.getSize());
      }
      if (AddGroupChildElementDialog.access$7(this$0) == null) {
        AddGroupChildElementDialog.access$9(this$0, AddGroupChildElementDialog.access$8(this$0).getSize());
      }
      AddGroupChildElementDialog.access$6(this$0, true, true, true, false);
      if ((AddGroupChildElementDialog.access$28(this$0).isDisposed()) && (AddGroupChildElementDialog.access$29(this$0).isDisposed()) && (AddGroupChildElementDialog.access$30(this$0).isDisposed()) && (AddGroupChildElementDialog.access$31(this$0).isDisposed()))
      {
        AddGroupChildElementDialog.access$32(this$0);
        AddGroupChildElementDialog.access$33(this$0);
      }
      AddGroupChildElementDialog.access$12(this$0).moveBelow(AddGroupChildElementDialog.access$31(this$0));
      AddGroupChildElementDialog.access$14(this$0).moveBelow(AddGroupChildElementDialog.access$12(this$0));
      
      AddGroupChildElementDialog.access$10(this$0);
      AddGroupChildElementDialog.access$11(this$0);
      
      Point size = new Point(access$4this$0).x + (access$30this$0).getSize().x - access$29this$0).getSize().x), 
        access$4this$0).y - access$7this$0).y);
      AddGroupChildElementDialog.access$15(this$0).layout();
      shell.setSize(size);
    }
    else
    {
      Shell shell = this$0.getShell();
      if (AddGroupChildElementDialog.access$4(this$0) == null) {
        AddGroupChildElementDialog.access$5(this$0, shell.getSize());
      }
      AddGroupChildElementDialog.access$6(this$0, true, true, true, true);
      if (AddGroupChildElementDialog.access$7(this$0) == null) {
        AddGroupChildElementDialog.access$9(this$0, AddGroupChildElementDialog.access$8(this$0).getSize());
      }
      AddGroupChildElementDialog.access$10(this$0);
      AddGroupChildElementDialog.access$11(this$0);
      
      Point size = new Point(access$4this$0).x, access$4this$0).y - 
        3 * access$7this$0).y);
      
      AddGroupChildElementDialog.access$15(this$0).layout();
      
      shell = this$0.getShell();
      shell.setSize(size);
    }
    AddGroupChildElementDialog.access$34(this$0, null);
    AddGroupChildElementDialog.access$35(this$0, null);
  }
  
  public void widgetDefaultSelected(SelectionEvent e)
  {
    widgetSelected(e);
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.setting.dialog.AddGroupChildElementDialog.TypeSelectionListener
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.setting.dialog;

import java.util.List;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.tizen.nativecpp.setting.model.ElementType;
import org.tizen.nativecpp.setting.util.ElementUtil;
import org.tizen.nativecpp.setting.util.ValueValidation;

public class AddGroupChildElementDialog
  extends Dialog
{
  private String id;
  private String title;
  private String type;
  private String value;
  private String min;
  private String max;
  private String appId;
  private String operation;
  private Text idField;
  private Text titleField;
  private Text valueField;
  private Text minField;
  private Text maxField;
  private Text appIdField;
  private Text operationField;
  private Combo typeField;
  private Combo boolValueField;
  private Label minLabel;
  private Label maxLabel;
  private Label valueLabel;
  private Label valueLabel2;
  private Label appIdLabel;
  private Label operationLabel;
  private Label errorMessageLabel;
  private Label errorMessageIcon;
  private Button okButton;
  private Composite container;
  private Point dialogDefaultSize;
  private Point fieldSize;
  private ElementType elementType;
  private final int NUMBER_OF_ATRIBUTE = 5;
  private final int WIDTH = 280;
  private final int VERTICAL_SPAN = 10;
  private final int ID = 0;
  private final int TITLE = 1;
  private final int VALUE = 2;
  private final int MIN = 3;
  private final int MAX = 4;
  private List<String> fIdList;
  private String[] errorList = new String[5];
  private final String DIALOG_TITLE = "Adding Group ChildElement";
  
  public AddGroupChildElementDialog(Shell parentShel, List<String> list)
  {
    super(parentShel);
    setShellStyle(2144);
    fIdList = list;
  }
  
  protected void buttonPressed(int buttonId)
  {
    if (buttonId == 0)
    {
      for (int i = 0; i < 5; i++) {
        if (errorList[i] != null)
        {
          setErrorMessage(errorList[i], ElementUtil.ERROR_IMG);
          okButton.setEnabled(false);
          return;
        }
      }
      id = idField.getText().trim();
      title = titleField.getText().trim();
      type = typeField.getText();
      
      String errorMessage = null;
      if (id.length() <= 0)
      {
        errorMessage = "The ID must not be empty.";
      }
      else if (title.length() <= 0)
      {
        errorMessage = "The title  must not be empty.";
      }
      else
      {
        ElementType elementType = ElementUtil.checkType(type);
        switch (elementType)
        {
        case integer: 
          break;
        case bool: 
          value = boolValueField.getText();
          break;
        case label: 
          appId = appIdField.getText().trim();
          operation = operationField.getText().trim();
          if (appId.length() <= 0) {
            errorMessage = "The appId  must not be empty.";
          } else if (operation.length() <= 0) {
            errorMessage = "The operation  must not be empty.";
          }
          break;
        case button: 
          break;
        case group: 
        case link: 
          min = minField.getText();
          max = maxField.getText();
          value = valueField.getText();
          if ((elementType.equals(ElementType.integer)) && (value.length() <= 0)) {
            errorMessage = "The value must not be empty.";
          } else if (min.length() <= 0) {
            errorMessage = "The min must not be empty.";
          } else if (max.length() <= 0) {
            errorMessage = "The max must not be empty.";
          }
          if (errorMessage == null)
          {
            min = changeValidInt(min);
            max = changeValidInt(max);
            if (!elementType.equals(ElementType.string)) {
              value = changeValidInt(value);
            } else {
              errorMessage = ValueValidation.checkCustomStringRange(Integer.parseInt(min), Integer.parseInt(max), value);
            }
          }
          break;
        case expanditem: 
        case expandlist: 
        case launch: 
        default: 
          errorMessage = "Unexpected Error";
        }
      }
      if (errorMessage == null)
      {
        super.buttonPressed(buttonId);
      }
      else
      {
        setErrorMessage(errorMessage, ElementUtil.ERROR_IMG);
        okButton.setEnabled(false);
      }
    }
    else
    {
      super.buttonPressed(buttonId);
    }
  }
  
  protected void createButtonsForButtonBar(Composite parent)
  {
    okButton = createButton(parent, 0, IDialogConstants.OK_LABEL, true);
    createButton(parent, 1, IDialogConstants.CANCEL_LABEL, false);
  }
  
  protected Control createDialogArea(Composite parent)
  {
    container = ((Composite)super.createDialogArea(parent));
    
    GridLayout gridLayout = new GridLayout();
    numColumns = 2;
    container.setLayout(gridLayout);
    
    Label typeLabel = new Label(container, 0);
    typeLabel.setLayoutData(new GridData(3, 2, 
      false, false));
    typeLabel.setText("Type:");
    
    typeField = new Combo(container, 8);
    typeField.setLayoutData(new GridData(4, 
      2, false, false));
    
    typeField.add("bool");
    typeField.add("expandlist");
    type
1 2 3 4 5 6 7 8 9

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