Package org.w3c.jigadmin

Examples of org.w3c.jigadmin.RemoteResourceWrapper


     * Drop a resource.
     * @param cell The resource cell
     * @see org.w3c.jigadmin.editors.ResourceCell
     */
    protected boolean dropResource(ResourceCell cell) {
  RemoteResourceWrapper rrw = getSelectedResourceWrapper();
  PropertyManager pm = PropertyManager.getPropertyManager();
  try {
      if (! pm.isExtensible(rrw)) {
    return false;
      } else if ((cell.isFrame() || cell.isFilter()) &&
           (pm.isEditable(rrw))) {
    //popupresource
    popupResource(rrw);
    return true;
      } else if (((cell.isContainer() || cell.isResource()) &&
      (! rrw.getResource().isIndexersCatalog()))
           ||
           (rrw.getResource().isIndexersCatalog() &&
      cell.isIndexer())) {
    //must be droppped on a Container
    if (rrw.getResource().isContainer()) {
        //add the resource
        String identifier = getIdentifier(cell, rrw);
        if (identifier != null) {
      TreePath path = getSelectionPath();
      addResource(identifier, cell.toString(),
View Full Code Here


             RemoteResourceWrapper rrwf, TreePath fpath)
  throws RemoteAccessException
    {
  RemoteResource rc =
      rrwf.getResource().registerResource(identifier, classname);
  RemoteResourceWrapper nrrw =
      new RemoteResourceWrapper(rrwf, rc);
  RemoteResourceWrapperNode parent =
      (RemoteResourceWrapperNode)fpath.getLastPathComponent();
  RemoteResourceWrapperNode child =
      new RemoteResourceWrapperNode(parent, nrrw, identifier);
  ((DefaultTreeModel)getModel()).insertNodeInto(child, parent, 0);
View Full Code Here

     */
    protected void addResourceToSelectedContainer(String classname,
              String identifier)
  throws RemoteAccessException         
    {
  RemoteResourceWrapper rrw = getSelectedResourceWrapper();
  if (rrw == null)
      return;
  addResource(identifier, classname, rrw, getSelectionPath());
    }
View Full Code Here

    /**
     * Add a (new) resource to the container associated to the
     * selected node.
     */
    protected void addResourceToSelectedContainer() {
  RemoteResourceWrapper selected = getSelectedResourceWrapper();
  PropertyManager pm = PropertyManager.getPropertyManager();
  try {
      if (selected == null) {
    JOptionPane.showMessageDialog(this,
                "No Container selected",
                "Error",
                JOptionPane.ERROR_MESSAGE);
    return;
      } else if (! pm.isExtensible(selected)) {
    JOptionPane.showMessageDialog(this,
                "The resource selected is not "+
                "extensible.",
                "Error",
                JOptionPane.ERROR_MESSAGE);
      }else if (selected.getResource().isContainer()) {
    Thread thread = new Thread() {
        public void run() {
      performAddResourceToSelectedContainer();
        }
    };
View Full Code Here

                "Reindex selected resource(s)?",
                "Reindex Resource(s)",
                JOptionPane.YES_NO_OPTION);
      if (result == JOptionPane.YES_OPTION) {
    for (int i = 0 ; i < path.length ; i++) {
        RemoteResourceWrapper rrw =
      getSelectedResourceWrapper(path[i]);
        if (rrw == null)
      continue;
        try {
      reindexResource(rrw, rec);
View Full Code Here

                "Delete Resource(s)",
                JOptionPane.YES_NO_OPTION);
      if (result == JOptionPane.YES_OPTION) {
    DefaultTreeModel model = (DefaultTreeModel) getModel();
    for (int i = 0 ; i < path.length ; i++) {
        RemoteResourceWrapper rrw =
      getSelectedResourceWrapper(path[i]);
        if (rrw == null)
      continue;
        try {
      if (pm.isEditable(rrw)) {
          deleteResource(rrw);
          MutableTreeNode node = (MutableTreeNode)
        path[i].getLastPathComponent();
          model.removeNodeFromParent(node);
      } else {
          String name = (String)
        rrw.getResource().getValue("identifier");
          Message.showInformationMessage(this, name+
                 " is not editable");
      }
        } catch (RemoteAccessException ex) {
      Message.showErrorMessage(this, ex);
View Full Code Here

     * to the resource associated to the selected node.
     * Display en error message (dialog) if no node is selected.
     */
    protected void showReferenceDocumentation() {
  try {
      RemoteResourceWrapper selected =
    getSelectedResourceWrapper();
      if (selected == null) {
    JOptionPane.showMessageDialog(this,
                "No Resource selected",
                "Error",
                JOptionPane.ERROR_MESSAGE);
    return;
      } else {
    String url = (String)
        selected.getResource().getValue("help-url");
    MiniBrowser.showDocumentationURL(url,
             "Reference documentation");
      }
  } catch (RemoteAccessException rae) {
      Message.showErrorMessage(this, rae);
View Full Code Here

    protected void doubleClick(TreePath path) {
  if (path == null)
      return;
  RemoteResourceWrapperNode node =
      (RemoteResourceWrapperNode) path.getLastPathComponent();
  RemoteResourceWrapper rrw = node.getResourceWrapper();
  PropertyManager pm = PropertyManager.getPropertyManager();
  if (pm.isEditable(rrw))
      popupResource(node.getResourceWrapper());
  else {
      try {
    String name = (String)
        rrw.getResource().getValue("identifier");
    Message.showInformationMessage(this, name+" is not editable");
      } catch (RemoteAccessException ex) {
    Message.showErrorMessage(this, ex);
      }
  }
View Full Code Here

      Message.showErrorMessage(rrw, ex);
  }
  if (frames == null)
      return;
  for(int i = 0; i < frames.length; i++) {
      RemoteResourceWrapper rrwf =
    new RemoteResourceWrapper(rrw, frames[i]);
      try {
    RemoteFrameWrapperNode node =
        new RemoteFrameWrapperNode(this, rrwf,
                 getFrameName(frames[i]));
    children.add(node);
View Full Code Here

      frame.invalidate();
      this.removeAll();
      this.admin = new AdminContext(adminurl);
      initialize();
      build();
      RemoteResourceWrapper rrw = serverList.getModel().
    getServer(ServerListModel.ADMIN_SERVER_NAME);
      serverSelected(ServerListModel.ADMIN_SERVER_NAME, rrw);
      frame.validate();
      setCursor(Cursor.DEFAULT_CURSOR);
      frame.setTitle("Server Browser : "+adminurl);
View Full Code Here

TOP

Related Classes of org.w3c.jigadmin.RemoteResourceWrapper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.