org.eclipse.jst.pagedesigner.jsf.ui_1.2.100.v201104061711

16:45:59.764 INFO  jd.cli.Main - Decompiling org.eclipse.jst.pagedesigner.jsf.ui_1.2.100.v201104061711.jar
package org.eclipse.jst.pagedesigner.jsf.core.dom;

import java.util.ArrayList;
import java.util.List;
import org.eclipse.jst.jsf.core.internal.tld.CMUtil;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

public class JSFDOMUtil
{
  public static Element findFacet(Element parentEle, String name)
  {
    NodeList childnodes = parentEle.getChildNodes();
    int i = 0;
    for (int size = childnodes.getLength(); i < size; i++)
    {
      Node node = childnodes.item(i);
      if ((node.getNodeType() == 1) && (isFacet((Element)node)))
      {
        Element ele = (Element)node;
        if (name.equals(ele.getAttribute("name"))) {
          return ele;
        }
      }
    }
    return null;
  }
  
  public static boolean isHColumn(Node node)
  {
    if ((node instanceof Element))
    {
      Element ele = (Element)node;
      if (("column".equalsIgnoreCase(ele.getLocalName())) && ("http://java.sun.com/jsf/html".equals(CMUtil.getElementNamespaceURI(ele)))) {
        return true;
      }
    }
    return false;
  }
  
  public static List getUIComponentChildren(Element panelGridEle)
  {
    List list = new ArrayList();
    NodeList childnodes = panelGridEle.getChildNodes();
    int i = 0;
    for (int size = childnodes.getLength(); i < size; i++)
    {
      Node node = childnodes.item(i);
      if (node.getNodeType() == 1) {
        if (!isFacet((Element)node)) {
          list.add(node);
        }
      }
    }
    return list;
  }
  
  public static boolean isFacet(Element ele)
  {
    return "facet".equals(ele.getLocalName());
  }
  
  public static boolean isUIParameter(Element ele)
  {
    return "param".equals(ele.getLocalName());
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.pagedesigner.jsf.core.dom.JSFDOMUtil
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.pagedesigner.jsf.ui;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.jst.jsf.common.ui.JSFUICommonPlugin;
import org.eclipse.jst.jsf.common.ui.internal.guiutils.Alerts;
import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;

public class JSFUIPlugin
  extends AbstractUIPlugin
{
  private static JSFUIPlugin _plugin;
  private ResourceBundle _resourceBundle;
  private URL _pluginBase;
  private static Logger _logger;
  private static Alerts _alerts;
  
  public JSFUIPlugin()
  {
    _plugin = this;
    try
    {
      _resourceBundle = ResourceBundle.getBundle("org.eclipse.jst.pagedesigner.jsf.ui.JSFUIPluginResources");
    }
    catch (MissingResourceException localMissingResourceException)
    {
      _resourceBundle = null;
    }
  }
  
  public void start(BundleContext context)
    throws Exception
  {
    super.start(context);
    _alerts = new Alerts(this, _resourceBundle);
    _logger = JSFUICommonPlugin.getLogger(JSFUIPlugin.class);
    
    _pluginBase = getBundle().getEntry("/");
  }
  
  public static Alerts getAlerts()
  {
    return _alerts;
  }
  
  public void stop(BundleContext context)
    throws Exception
  {
    super.stop(context);
  }
  
  public static JSFUIPlugin getDefault()
  {
    return _plugin;
  }
  
  public static String getResourceString(String key)
  {
    ResourceBundle bundle = getDefault().getResourceBundle();
    try
    {
      return bundle != null ? bundle.getString(key) : key;
    }
    catch (MissingResourceException localMissingResourceException) {}
    return key;
  }
  
  public ResourceBundle getResourceBundle()
  {
    return _resourceBundle;
  }
  
  public Image getImage(String name)
  {
    if (name == null) {
      return null;
    }
    ImageRegistry images = getImageRegistry();
    Image image = images.get(name);
    if (image == null) {
      try
      {
        ImageDescriptor id = ImageDescriptor.createFromURL(new URL(_pluginBase, 
          "icons/" + name));
        images.put(name, id);
        
        image = images.get(name);
      }
      catch (MalformedURLException ee)
      {
        _logger.error("Error.JSFUIPlugin", name, ee);
      }
    }
    return image;
  }
  
  public static void log(int severity, String message, Throwable exception)
  {
    ILog log = getDefault().getLog();
    IStatus status = new Status(
      severity, 
      "org.eclipse.jst.pagedesigner.jsf.ui", 
      message, 
      exception);
    log.log(status);
  }
  
  public static void log(int severity, String message)
  {
    ILog log = getDefault().getLog();
    IStatus status = new Status(
      severity, 
      "org.eclipse.jst.pagedesigner.jsf.ui", 
      message);
    log.log(status);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.pagedesigner.jsf.ui.JSFUIPlugin
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.pagedesigner.jsf.ui.actions;

import java.util.MissingResourceException;
import java.util.ResourceBundle;

public class ActionsResources
{
  private static final String BUNDLE_NAME = "org.eclipse.jst.pagedesigner.jsf.ui.actions.ActionsResources";
  private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle("org.eclipse.jst.pagedesigner.jsf.ui.actions.ActionsResources");
  
  public static String getString(String key)
  {
    try
    {
      return RESOURCE_BUNDLE.getString(key);
    }
    catch (MissingResourceException localMissingResourceException) {}
    return '!' + key + '!';
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.pagedesigner.jsf.ui.actions.ActionsResources
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.pagedesigner.jsf.ui.actions;

import org.eclipse.jst.pagedesigner.properties.attrgroup.DialogUtil;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;

public class AddActionListenerAction
  extends JSFAddChildAction
{
  public AddActionListenerAction(IDOMElement parentEle)
  {
    super("ActionListener", parentEle);
  }
  
  public void run()
  {
    DialogUtil.createSubElement(getShell(), getParentElement(), "http://java.sun.com/jsf/core", "actionListener", new String[] { "type" });
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.pagedesigner.jsf.ui.actions.AddActionListenerAction
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.pagedesigner.jsf.ui.actions;

import org.eclipse.jst.pagedesigner.properties.attrgroup.DialogUtil;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;

public class AddAttributeAction
  extends JSFAddChildAction
{
  public AddAttributeAction(IDOMElement parentNode)
  {
    super(ActionsResources.getString("AddAttributeAction.ActionLabel.Attribute"), parentNode);
  }
  
  public void run()
  {
    DialogUtil.createSubElement(getShell(), getParentElement(), "http://java.sun.com/jsf/core", "attribute", new String[] { "name", "value" });
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.pagedesigner.jsf.ui.actions.AddAttributeAction
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.pagedesigner.jsf.ui.actions;

import org.eclipse.jst.pagedesigner.jsf.ui.commands.jsfhtml.AddJSFCoreChildCommand;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;

public class AddConvertDateTimeAction
  extends JSFAddChildAction
{
  public AddConvertDateTimeAction(IDOMElement parentNode)
  {
    super(ActionsResources.getString("AddConvertDateTimeAction.ActionLabel.DateTime"), parentNode);
  }
  
  public void run()
  {
    AddJSFCoreChildCommand command = new AddJSFCoreChildCommand(getParentElement(), 
      "convertDateTime", null);
    command.execute();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.pagedesigner.jsf.ui.actions.AddConvertDateTimeAction
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.pagedesigner.jsf.ui.actions;

import org.eclipse.jst.pagedesigner.jsf.ui.commands.jsfhtml.AddJSFCoreChildCommand;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;

public class AddConvertNumberAction
  extends JSFAddChildAction
{
  public AddConvertNumberAction(IDOMElement parentNode)
  {
    super(ActionsResources.getString("AddConvertNumberAction.ActionLabel.Number"), parentNode);
  }
  
  public void run()
  {
    AddJSFCoreChildCommand command = new AddJSFCoreChildCommand(getParentElement(), 
      "convertNumber", null);
    command.execute();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.pagedesigner.jsf.ui.actions.AddConvertNumberAction
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.pagedesigner.jsf.ui.actions;

import java.util.HashMap;
import java.util.Map;
import org.eclipse.jst.pagedesigner.jsf.ui.commands.jsfhtml.AddJSFCoreChildCommand;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;

public class AddConverterAction
  extends JSFAddChildAction
{
  String _converterId;
  
  public AddConverterAction(String converterId, IDOMElement parentNode)
  {
    super(converterId, parentNode);
    _converterId = converterId;
  }
  
  public void run()
  {
    Map attributes = new HashMap();
    attributes.put("converterId", _converterId);
    AddJSFCoreChildCommand command = new AddJSFCoreChildCommand(getParentElement(), 
      "converter", attributes);
    command.execute();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.pagedesigner.jsf.ui.actions.AddConverterAction
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.pagedesigner.jsf.ui.actions;

import org.eclipse.jst.pagedesigner.properties.attrgroup.DialogUtil;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;

public class AddParamAction
  extends JSFAddChildAction
{
  public AddParamAction(IDOMElement parentNode)
  {
    super(ActionsResources.getString("AddParamAction.ActionLabel.Param"), parentNode);
  }
  
  public void run()
  {
    DialogUtil.createSubElement(getShell(), getParentElement(), "http://java.sun.com/jsf/core", 
      "param", new String[] { "name", "value" });
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.pagedesigner.jsf.ui.actions.AddParamAction
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.pagedesigner.jsf.ui.actions;

import org.eclipse.jst.pagedesigner.properties.attrgroup.DialogUtil;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;

public class AddSelectItemAction
  extends JSFAddChildAction
{
  public AddSelectItemAction(IDOMElement parentNode)
  {
    super(ActionsResources.getString("AddSelectItemAction.ActionLabel.SelectItem"), parentNode);
  }
  
  public void run()
  {
    DialogUtil.createSubElement(getShell(), getParentElement(), "http://java.sun.com/jsf/core", 
      "selectItem", new String[] { "itemLabel", "itemValue" });
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.pagedesigner.jsf.ui.actions.AddSelectItemAction
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.pagedesigner.jsf.ui.actions;

import org.eclipse.jst.pagedesigner.properties.attrgroup.DialogUtil;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;

public class AddSelectItemsAction
  extends JSFAddChildAction
{
  public AddSelectItemsAction(IDOMElement parentNode)
  {
    super(ActionsResources.getString("AddSelectItemsAction.ActionLabel.SelectItems"), parentNode);
  }
  
  public void run()
  {
    DialogUtil.createSubElement(getShell(), getParentElement(), "http://java.sun.com/jsf/core", 
      "selectItems", new String[] { "id", "binding", "value" });
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.pagedesigner.jsf.ui.actions.AddSelectItemsAction
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.pagedesigner.jsf.ui.actions;

import org.eclipse.jst.pagedesigner.properties.attrgroup.DialogUtil;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;

public class AddValidateDoubleRangeAction
  extends JSFAddChildAction
{
  public AddValidateDoubleRangeAction(IDOMElement parentNode)
  {
    super(ActionsResources.getString("AddValidateDoubleRangeAction.ActionLabel.DoubleRange"), parentNode);
  }
  
  public void run()
  {
    DialogUtil.createSubElement(getShell(), getParentElement(), "http://java.sun.com/jsf/core", 
      "validateDoubleRange", new String[] { "minimum", 
      "maximum" });
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.pagedesigner.jsf.ui.actions.AddValidateDoubleRangeAction
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.pagedesigner.jsf.ui.actions;

import org.eclipse.jst.pagedesigner.properties.attrgroup.DialogUtil;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;

public class AddValidateLengthAction
  extends JSFAddChildAction
{
  public AddValidateLengthAction(IDOMElement parentNode)
  {
    super(ActionsResources.getString("AddValidateLengthAction.ActionLabel.Length"), parentNode);
  }
  
  public void run()
  {
    DialogUtil.createSubElement(getShell(), getParentElement(), "http://java.sun.com/jsf/core", 
      "validateLength", new String[] { "minimum", 
      "maximum" });
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.pagedesigner.jsf.ui.actions.AddValidateLengthAction
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.pagedesigner.jsf.ui.actions;

import org.eclipse.jst.pagedesigner.properties.attrgroup.DialogUtil;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;

public class AddValidateLongRangeAction
  extends JSFAddChildAction
{
  public AddValidateLongRangeAction(IDOMElement parentNode)
  {
    super(ActionsResources.getString("AddValidateLongRangeAction.ActionLabel.LongRange"), parentNode);
  }
  
  public void run()
  {
    DialogUtil.createSubElement(getShell(), getParentElement(), "http://java.sun.com/jsf/core", 
      "validateLongRange", new String[] { "minimum", 
      "maximum" });
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.pagedesigner.jsf.ui.actions.AddValidateLongRangeAction
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.pagedesigner.jsf.ui.actions;

import java.util.HashMap;
import java.util.Map;
import org.eclipse.jst.pagedesigner.jsf.ui.commands.jsfhtml.AddJSFCoreChildCommand;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;

public class AddValidatorAction
  extends JSFAddChildAction
{
  String _validatorId;
  
  public AddValidatorAction(String validatorId, IDOMElement parentNode)
  {
    super(validatorId, parentNode);
    _validatorId = validatorId;
  }
  
  public void run()
  {
    Map attributes = new HashMap();
    attributes.put("validatorId", _validatorId);
    AddJSFCoreChildCommand command = new AddJSFCoreChildCommand(getParentElement(), 
      "validator", attributes);
    command.execute();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.pagedesigner.jsf.ui.actions.AddValidatorAction
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.pagedesigner.jsf.ui.actions;

import org.eclipse.jst.pagedesigner.properties.attrgroup.DialogUtil;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;

public class AddValueChangeListenerAction
  extends JSFAddChildAction
{
  public AddValueChangeListenerAction(IDOMElement parentNode)
  {
    super(ActionsResources.getString("AddValueChangeListenerAction.ActionLabel.ValueChangeListener"), parentNode);
  }
  
  public void run()
  {
    DialogUtil.createSubElement(getShell(), getParentElement(), "http://java.sun.com/jsf/core", 
      "valueChangeListener", new String[] { "type" });
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.pagedesigner.jsf.ui.actions.AddValueChangeListenerAction
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.pagedesigner.jsf.ui.actions;

import org.eclipse.gef.EditPart;
import org.eclipse.gef.commands.Command;
import org.eclipse.jface.action.Action;
import org.eclipse.jst.pagedesigner.jsf.ui.elementedit.request.DeleteHColumnHeaderFooterRequest;

public class DeleteHColumnHeaderFooterAction
  extends Action
{
  private Command _command;
  
  public DeleteHColumnHeaderFooterAction(String text, EditPart editPart, boolean isHeader)
  {
    super(text);
    DeleteHColumnHeaderFooterRequest req = new DeleteHColumnHeaderFooterRequest(text, isHeader);
    _command = editPart.getCommand(req);
    setEnabled((_command != null) && (_command.canExecute()));
  }
  
  public void run()
  {
    _command.execute();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.pagedesigner.jsf.ui.actions.DeleteHColumnHeaderFooterAction
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.pagedesigner.jsf.ui.actions;

import org.eclipse.gef.EditPart;
import org.eclipse.gef.commands.Command;
import org.eclipse.jface.action.Action;
import org.eclipse.jst.pagedesigner.jsf.ui.elementedit.request.DeleteHeaderFooterRequest;

public class DeleteHeaderFooterAction
  extends Action
{
  private Command _command;
  
  public DeleteHeaderFooterAction(String text, EditPart editPart, boolean isHeader)
  {
    super(text);
    DeleteHeaderFooterRequest req = new DeleteHeaderFooterRequest(text, isHeader);
    _command = editPart.getCommand(req);
    setEnabled((_command != null) && (_command.canExecute()));
  }
  
  public void run()
  {
    _command.execute();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.pagedesigner.jsf.ui.actions.DeleteHeaderFooterAction
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.pagedesigner.jsf.ui.actions;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.jface.action.Action;
import org.eclipse.jst.jsf.common.ui.internal.guiutils.Alerts;
import org.eclipse.jst.pagedesigner.jsf.ui.JSFUIPlugin;
import org.eclipse.jst.pagedesigner.jsp.core.pagevar.IPageVariablesProvider;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;

public class ExpressionAction
  extends Action
{
  public static final int METHOD = 0;
  public static final int VARIABLE = 1;
  private String _action;
  private IProject _project;
  private IFile _file;
  
  public void setActionValue(String attribute)
  {
    _action = attribute;
  }
  
  public boolean isEnabled()
  {
    return (_project != null) && (isExpression());
  }
  
  private boolean isExpression()
  {
    boolean flag = false;
    if (_action != null) {
      flag = (_action.startsWith("#{")) && (_action.endsWith("}"));
    }
    return flag;
  }
  
  public void run()
  {
    IPageVariablesProvider pageVarProvider = (IPageVariablesProvider)getPage().getActiveEditor().getAdapter(
      IPageVariablesProvider.class);
    pageVarProvider.refresh();
    
    JSFUIPlugin.getAlerts().warning("Message.Warning.Title", "Message.Warning.InvalidateExpression");
  }
  
  public void setProject(IProject projectFor)
  {
    _project = projectFor;
  }
  
  private IWorkbenchPage getPage()
  {
    IWorkbench workbench = PlatformUI.getWorkbench();
    IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
    return window.getActivePage();
  }
  
  public void setFile(IFile fileFor)
  {
    _file = fileFor;
  }
  
  public IFile getFile()
  {
    return _file;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.pagedesigner.jsf.ui.actions.ExpressionAction
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.pagedesigner.jsf.ui.actions;

public abstract interface IJSFCoreSupport
{
  public abstract boolean isActionSource();
  
  public abstract boolean isUIComponent();
  
  public abstract boolean isValueHolder();
  
  public abstract boolean isEditableValueHolder();
  
  public abstract boolean supportSelectItems();
}

/* Location:
 * Qualified Name:     org.eclipse.jst.pagedesigner.jsf.ui.actions.IJSFCoreSupport
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.pagedesigner.jsf.ui.actions;

import org.eclipse.gef.EditPart;
import org.eclipse.gef.commands.Command;
import org.eclipse.jface.action.Action;
import org.eclipse.jst.pagedesigner.jsf.ui.elementedit.request.InsertHColumnHeaderFooterRequest;

public class InsertHColumnHeaderFooterAction
  extends Action
{
  private Command _command;
  
  public InsertHColumnHeaderFooterAction(String text, EditPart editPart, boolean isHeader)
  {
    super(text);
    
    InsertHColumnHeaderFooterRequest req = new InsertHColumnHeaderFooterRequest(text, isHeader);
    _command = editPart.getCommand(req);
    setEnabled((_command != null) && (_command.canExecute()));
  }
  
  public void run()
  {
    _command.execute();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.pagedesigner.jsf.ui.actions.InsertHColumnHeaderFooterAction
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.pagedesigner.jsf.ui.actions;

import org.eclipse.gef.EditPart;
import org.eclipse.gef.commands.Command;
import org.eclipse.jface.action.Action;
import org.eclipse.jst.pagedesigner.jsf.ui.elementedit.request.InsertHeaderFooterRequest;

public class InsertHeaderFooterAction
  extends Action
{
  private Command _command;
  
  public InsertHeaderFooterAction(String text, EditPart editPart, boolean isHeader)
  {
    super(text);
    
    InsertHeaderFooterRequest req = new InsertHeaderFooterRequest(text, isHeader);
    _command = editPart.getCommand(req);
    setEnabled((_command != null) && (_command.canExecute()));
  }
  
  public void run()
  {
    _command.execute();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.pagedesigner.jsf.ui.actions.InsertHeaderFooterAction
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.pagedesigner.jsf.ui.actions;

import org.eclipse.jface.action.Action;

class JSFAddActionGroup$1
  extends Action
{}

/* Location:
 * Qualified Name:     org.eclipse.jst.pagedesigner.jsf.ui.actions.JSFAddActionGroup.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.pagedesigner.jsf.ui.actions;

import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;

class JSFAddActionGroup$2
  implements IMenuListener
{
  JSFAddActionGroup$2(JSFAddActionGroup paramJSFAddActionGroup, IMenuManager paramIMenuManager, IDOMElement paramIDOMElement, IJSFCoreSupport paramIJSFCoreSupport) {}
  
  public void menuAboutToShow(IMenuManager manager)
  {
    val$submenu.removeAll();
    JSFAddActionGroup.access$0(this$0, val$submenu, val$element, val$support);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.pagedesigner.jsf.ui.actions.JSFAddActionGroup.2
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.pagedesigner.jsf.ui.actions;

import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jst.jsf.core.jsfappconfig.internal.IJSFAppConfigManager;
import org.eclipse.jst.jsf.core.jsfappconfig.internal.JSFAppConfigManagerFactory;
import org.eclipse.jst.jsf.facesconfig.emf.ConverterIdType;
import org.eclipse.jst.jsf.facesconfig.emf.ConverterType;
import org.eclipse.jst.jsf.facesconfig.emf.ValidatorIdType;
import org.eclipse.jst.jsf.facesconfig.emf.ValidatorType;
import org.eclipse.jst.pagedesigner.utils.StructuredModelUtil;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;

public class JSFAddActionGroup
{
  private static final Action EMPTY_ACTION = new Action() {};
  
  public void fillContextMenu(IMenuManager menu, final IDOMElement element, final IJSFCoreSupport support)
  {
    IContributionItem item = menu.find("org.eclipse.jst.pagedesigner.context.submenu.insert");
    if ((item instanceof IMenuManager))
    {
      final IMenuManager submenu = (IMenuManager)item;
      submenu.add(EMPTY_ACTION);
      submenu.addMenuListener(new IMenuListener()
      {
        public void menuAboutToShow(IMenuManager manager)
        {
          submenu.removeAll();
          JSFAddActionGroup.this.addJSFAddItems(submenu, element, support);
        }
      });
    }
  }
  
  private void addJSFAddItems(IMenuManager submenu, IDOMElement element, IJSFCoreSupport support)
  {
    AddActionListenerAction actionListenerAction = new AddActionListenerAction(
      element);
    actionListenerAction.setEnabled(support.isActionSource());
    submenu.add(actionListenerAction);
    
    AddAttributeAction attrAction = new AddAttributeAction(element);
    attrAction.setEnabled(support.isUIComponent());
    submenu.add(attrAction);
    
    IProject prj = null;
    IFile file = StructuredModelUtil.getFileFor(element.getModel());
    if (file != null) {
      prj = file.getProject();
    }
    IMenuManager converterMenu = new MenuManager(
      ActionsResources.getString("Submenu.JSFAdd.Converter"));
    boolean supportConverter = support.isValueHolder();
    String[] converterIds = getRegisteredConverterIds(prj);
    if ((converterIds != null) && (converterIds.length > 0))
    {
      for (int i = 0; i < converterIds.length; i++)
      {
        AddConverterAction action = new AddConverterAction(
          converterIds[i], element);
        action.setEnabled(supportConverter);
        converterMenu.add(action);
      }
      converterMenu.add(new Separator());
    }
    AddConvertDateTimeAction dateTimeAction = new AddConvertDateTimeAction(
      element);
    dateTimeAction.setEnabled(supportConverter);
    converterMenu.add(dateTimeAction);
    AddConvertNumberAction numberAction = new AddConvertNumberAction(
      element);
    numberAction.setEnabled(supportConverter);
    converterMenu.add(numberAction);
    submenu.add(converterMenu);
    
    AddParamAction addParamAction = new AddParamAction(element);
    addParamAction.setEnabled(support.isUIComponent());
    submenu.add(addParamAction);
    
    AddSelectItemAction selectItemAction = new AddSelectItemAction(element);
    selectItemAction.setEnabled(support.supportSelectItems());
    submenu.add(selectItemAction);
    
    AddSelectItemsAction selectItemsAction = new AddSelectItemsAction(
      element);
    selectItemsAction.setEnabled(support.supportSelectItems());
    submenu.add(selectItemsAction);
    
    IMenuManager validatorMenu = new MenuManager(
      ActionsResources.getString("Submenu.JSFAdd.Validators"));
    boolean supportValidator = support.isEditableValueHolder();
    String[] validatorIds = getRegisteredValidatorIds(prj);
    if ((validatorIds != null) && (validatorIds.length > 0))
    {
      for (int i = 0; i < validatorIds.length; i++)
      {
        AddValidatorAction action = new AddValidatorAction(
          validatorIds[i], element);
        action.setEnabled(supportValidator);
        validatorMenu.add(action);
      }
      validatorMenu.add(new Separator());
    }
    AddValidateDoubleRangeAction doubleRangeAction = new AddValidateDoubleRangeAction(
      element);
    doubleRangeAction.setEnabled(supportValidator);
    validatorMenu.add(doubleRangeAction);
    AddValidateLengthAction lengthAction = new AddValidateLengthAction(
      element);
    lengthAction.setEnabled(supportValidator);
    validatorMenu.add(lengthAction);
    AddValidateLongRangeAction longRangeAction = new AddValidateLongRangeAction(
      element);
    longRangeAction.setEnabled(supportValidator);
    validatorMenu.add(longRangeAction);
    submenu.add(validatorMenu);
    
    AddValueChangeListenerAction valueChangeAction = new AddValueChangeListenerAction(
      element);
    valueChangeAction.setEnabled(support.isEditableValueHolder());
    submenu.add(valueChangeAction);
  }
  
  private String[] getRegisteredValidatorIds(IProject project)
  {
    String[] result = (String[])null;
    
    IJSFAppConfigManager appConfigMgr = 
      JSFAppConfigManagerFactory.getJSFAppConfigManagerInstance(project);
    if (appConfigMgr != null)
    {
      List<ValidatorType> list = appConfigMgr.getValidators();
      result = new String[list.size()];
      int i = 0;
      for (ValidatorType validator : list)
      {
        ValidatorIdType validatorId = validator.getValidatorId();
        if (validatorId != null) {
          result[(i++)] = (validatorId.getTextContent() != null ? 
            validatorId.getTextContent().trim() : "");
        }
      }
    }
    return result;
  }
  
  private String[] getRegisteredConverterIds(IProject project)
  {
    String[] result = (String[])null;
    
    IJSFAppConfigManager appConfigMgr = 
      JSFAppConfigManagerFactory.getJSFAppConfigManagerInstance(project);
    if (appConfigMgr != null)
    {
      List<ConverterType> list = appConfigMgr.getConverters();
      
      List<String> converterIdList = new ArrayList();
      for (ConverterType converter : list)
      {
        ConverterIdType converterId = converter.getConverterId();
        if (converterId != null) {
          converterIdList.add(converterId.getTextContent() != null ? 
            converterId.getTextContent().trim() : "");
        }
      }
      result = new String[converterIdList.size()];
      result = (String[])converterIdList.toArray(result);
    }
    return result;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.pagedesigner.jsf.ui.actions.JSFAddActionGroup
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.pagedesigner.jsf.ui.actions;

import org.eclipse.jface.action.Action;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;

public class JSFAddChildAction
  extends Action
{
  private IDOMElement _parentEle;
  
  public JSFAddChildAction(String text, IDOMElement parentNode)
  {
    super(text);
    _parentEle = parentNode;
  }
  
  public IDOMElement getParentElement()
  {
    return _parentEle;
  }
  
  public Shell getShell()
  {
    IWorkbench bench = PlatformUI.getWorkbench();
    if (bench != null)
    {
      IWorkbenchWindow window = bench.getActiveWorkbenchWindow();
      if (window == null)
      {
        IWorkbenchWindow[] windows = bench.getWorkbenchWindows();
        if ((windows != null) && (windows.length > 0)) {
          window = windows[0];
        }
      }
      if (window != null) {
        return window.getShell();
      }
    }
    return null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.pagedesigner.jsf.ui.actions.JSFAddChildAction
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.pagedesigner.jsf.ui.actions;

import org.eclipse.gef.EditPart;
import org.eclipse.jst.pagedesigner.actions.link.AbstractLinkCreator;
import org.eclipse.jst.pagedesigner.actions.link.LinkUtil;
import org.eclipse.jst.pagedesigner.parts.TextEditPart;
import org.eclipse.jst.pagedesigner.utils.JSPUtil;
import org.eclipse.jst.pagedesigner.viewer.DesignPosition;
import org.eclipse.jst.pagedesigner.viewer.DesignRange;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.Text;

public class JSFCommandLinkCreator
  extends AbstractLinkCreator
{
  public Element makeLinkElement(EditPart part, DesignRange range)
  {
    if ((part instanceof TextEditPart))
    {
      Text middleNode = LinkUtil.splitDomText(part, range);
      EditPart parent = part.getParent();
      Node parentNode = (Node)parent.getModel();
      Document doc = (parentNode instanceof Document) ? (Document)parentNode : parentNode.getOwnerDocument();
      
      IDOMModel model = ((IDOMNode)parentNode).getModel();
      String prefix = JSPUtil.getOrCreatePrefix(model, "http://java.sun.com/jsf/html", "h");
      JSPUtil.getOrCreatePrefix(model, "http://java.sun.com/jsf/core", "f");
      
      Element commandLink = doc.createElement("commandLink");
      commandLink.setPrefix(prefix);
      Element outputText = doc.createElement("outputText");
      outputText.setPrefix(prefix);
      outputText.setAttribute("value", middleNode.getNodeValue());
      commandLink.appendChild(outputText);
      
      parentNode.replaceChild(commandLink, middleNode);
      return commandLink;
    }
    return null;
  }
  
  public boolean canExecute(DesignRange range)
  {
    DesignPosition startPosition = range.getStartPosition();
    EditPart part = startPosition.getContainerPart();
    IDOMNode node = (IDOMNode)part.getModel();
    IDOMModel model = node.getModel();
    return model.getDocument().getElementsByTagNameNS("http://java.sun.com/jsf/html", "view") != null;
  }
  
  public String getSourcePreview(EditPart part, DesignRange range)
  {
    if ((part instanceof TextEditPart))
    {
      TextEditPart textPart = (TextEditPart)part;
      int[] offsets = textPart.getSelectedRange();
      
      String displayData = textPart.getTextData();
      String linkExp = displayData.substring(offsets[0], offsets[1]);
      
      StringBuffer sb = new StringBuffer();
      sb.append("<h:commandLink>\n<h:outputText value=\"");
      sb.append(linkExp);
      sb.append("\">");
      sb.append("</h:outputText>\n</h:commandLink>");
      return sb.toString();
    }
    return null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.pagedesigner.jsf.ui.actions.JSFCommandLinkCreator
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.pagedesigner.jsf.ui.actions;

import org.eclipse.jface.action.Action;

class JSFNavigationGroup$1
  extends Action
{}

/* Location:
 * Qualified Name:     org.eclipse.jst.pagedesigner.jsf.ui.actions.JSFNavigationGroup.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.pagedesigner.jsf.ui.actions;

import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;

class JSFNavigationGroup$2
  implements IMenuListener
{
  JSFNavigationGroup$2(JSFNavigationGroup paramJSFNavigationGroup, IMenuManager paramIMenuManager, IDOMElement paramIDOMElement, IJSFCoreSupport paramIJSFCoreSupport) {}
  
  public void menuAboutToShow(IMenuManager manager)
  {
    val$javaMenu.removeAll();
    JSFNavigationGroup.access$0(this$0, val$javaMenu, val$element, val$support);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.pagedesigner.jsf.ui.actions.JSFNavigationGroup.2
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.pagedesigner.jsf.ui.actions;

import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jst.pagedesigner.jsf.ui.JSFUIPlugin;
import org.eclipse.jst.pagedesigner.utils.StructuredModelUtil;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;

public class JSFNavigationGroup
{
  private static final Action EMPTY_ACTION = new Action() {};
  
  public void fillContextMenu(IMenuManager menu, final IDOMElement element, final IJSFCoreSupport support)
  {
    IContributionItem item = 
      menu.find("org.eclipse.jst.pagedesigner.context.submenu.navigate");
    if ((item instanceof IMenuManager))
    {
      IMenuManager submenu = (IMenuManager)item;
      final IMenuManager javaMenu = new MenuManager(JSFUIPlugin.getResourceString("ElementEdit.Submenu.JavaNavigation"));
      javaMenu.add(EMPTY_ACTION);
      javaMenu.addMenuListener(new IMenuListener()
      {
        public void menuAboutToShow(IMenuManager manager)
        {
          javaMenu.removeAll();
          JSFNavigationGroup.this.addNavigationItems(javaMenu, element, support);
        }
      });
      submenu.appendToGroup("org.eclipse.jst.pagedesigner.navigate", javaMenu);
    }
  }
  
  private void addNavigationItems(IMenuManager submenu, IDOMElement ele, IJSFCoreSupport support)
  {
    if (support.isActionSource())
    {
      ExpressionAction action = new ExpressionAction();
      action.setText(JSFUIPlugin.getResourceString("ElementEdit.Submenu.JavaNavigation.Action"));
      if (ele != null)
      {
        action.setActionValue(ele.getAttribute("action"));
        IDOMModel model = ele.getModel();
        action.setProject(StructuredModelUtil.getProjectFor(model));
        action.setFile(StructuredModelUtil.getFileFor(model));
      }
      submenu.add(action);
    }
    if (support.isValueHolder())
    {
      ExpressionAction action = new ExpressionAction();
      action.setText(JSFUIPlugin.getResourceString("ElementEdit.Submenu.JavaNavigation.Value"));
      if (ele != null)
      {
        action.setActionValue(ele.getAttribute("value"));
        IDOMModel model = ele.getModel();
        action.setProject(StructuredModelUtil.getProjectFor(model));
        action.setFile(StructuredModelUtil.getFileFor(model));
      }
      submenu.add(action);
    }
    ExpressionAction action = new ExpressionAction();
    action.setText(JSFUIPlugin.getResourceString("ElementEdit.Submenu.JavaNavigation.Binding"));
    if (ele != null)
    {
      action.setActionValue(ele.getAttribute("binding"));
      IDOMModel model = ele.getModel();
      action.setProject(StructuredModelUtil.getProjectFor(model));
      action.setFile(StructuredModelUtil.getFileFor(model));
    }
    submenu.add(action);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.pagedesigner.jsf.ui.actions.JSFNavigationGroup
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.pagedesigner.jsf.ui.actions;

import org.eclipse.gef.EditPart;
import org.eclipse.jst.pagedesigner.actions.link.AbstractLinkCreator;
import org.eclipse.jst.pagedesigner.actions.link.LinkUtil;
import org.eclipse.jst.pagedesigner.parts.TextEditPart;
import org.eclipse.jst.pagedesigner.utils.JSPUtil;
import org.eclipse.jst.pagedesigner.viewer.DesignPosition;
import org.eclipse.jst.pagedesigner.viewer.DesignRange;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom
1 2 3 4 5 6 7 8 9 10 11 12

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