Package org.w3c.jigsaw.admin

Examples of org.w3c.jigsaw.admin.RemoteResource


     * @return a RemoteResourceWrapper instance
     */
    public RemoteResourceWrapper getChildResource(String name)
  throws RemoteAccessException
    {
  RemoteResource resource = null;
  resource = getResource().loadResource(name);
  return new RemoteResourceWrapper(this, resource);
    }
View Full Code Here


  throws RemoteAccessException
    {
  if(initialized)
      return;

  RemoteResource rr;
  AttributeDescription b[] = null;
  String s[] = null;
  int nbn = 0;
  boolean authorized;
 

  this.rrw = rrw;
  rr = rrw.getResource();
  authorized = false;
  while(!authorized) {
      try {
    authorized = true;
    b = rr.getAttributes();
      } catch (RemoteAccessException ex) {
    if(ex.getMessage().equals("Unauthorized")) {
        authorized = false;
    } else {
        throw ex;
    }
      } finally {
    if(!authorized) {
        rrw.getBrowser().popupDialog("admin");
    }
      }
  }
  // we select only the editable Attributes.
  for(int i=0; i<b.length; i++)
      if(b[i] == null)
    nbn++;
      else
    if(!b[i].getAttribute().checkFlag(Attribute.EDITABLE))
        nbn++;
  a = new AttributeDescription[b.length-nbn];
  ae = new AttributeEditor[a.length];
  int j = 0;
  for(int i=0; i<b.length; i++) {
      if(b[i] != null &&
         b[i].getAttribute().checkFlag(Attribute.EDITABLE)) {
    a[j++] = b[i];
      }
  }

  // add all the attribute editors

  Label l;
  GridBagLayout gbl = new GridBagLayout();
  GridBagConstraints gbc = new GridBagConstraints();
  Panel p = new Panel(gbl);
  p.setForeground(new Color(0,0,128));
  pwidget = new ScrollPane();
  gbc.fill = GridBagConstraints.HORIZONTAL;
  gbc.weightx = 0;
  gbc.weighty = 0;
  for(int i=0; i<a.length; i++) {
      if(a[i] != null) {
    PropertyManager pm = PropertyManager.getPropertyManager();
    Properties attrProps =
        pm.getAttributeProperties(rrw, a[i].getAttribute());
    String labelText = (String) attrProps.get("label");
    if ( labelText == null )
        labelText = a[i].getName();
    l = new Label(labelText, Label.RIGHT);
    ae[i] = AttributeEditorFactory.getEditor(rrw,
               a[i].getAttribute());
    authorized = false;
    while(!authorized) {
        try {
      authorized = true;
      ae[i].initialize(rrw, a[i].getAttribute(),
           a[i].getValue(), attrProps);
        } catch (RemoteAccessException ex) {
      if(ex.getMessage().equals("Unauthorized")) {
          authorized = false;
      } else {
          throw ex;
      }
        } finally {
      if(!authorized) {
          rrw.getBrowser().popupDialog("admin");
      }
        }
    }
    gbc.gridwidth = 1;
    gbl.setConstraints(l, gbc);
    p.add(l);
    gbc.gridwidth = GridBagConstraints.REMAINDER;
    gbl.setConstraints(ae[i].getComponent(), gbc);
    p.add(ae[i].getComponent());
      }
  }
  pwidget.add(p);
  widget.add("Center", pwidget);
  // Now add the reset/commit button bar

  Panel  toolpane= new Panel(new BorderLayout());
  Button commitb = new Button(COMMIT_L);
  Button resetb  = new Button(RESET_L);

  MouseButtonListener mbl = new MouseButtonListener();
  commitb.addMouseListener(mbl);
  resetb.addMouseListener(mbl);

  ButtonBarListener bbl = new ButtonBarListener();
  commitb.addActionListener(bbl);
  resetb.addActionListener(bbl);

  message = new Label("", Label.CENTER);
  message.setForeground(Color.white);
  message.setBackground(Color.gray);

  BorderPanel pmsg = new BorderPanel(BorderPanel.IN, 2);
  pmsg.setLayout(new BorderLayout());
  pmsg.add("Center", message);

  toolpane.add("West", commitb);
  toolpane.add("Center", pmsg);
  toolpane.add("East", resetb);

  widget.add("South", toolpane);
  // add information about the class of the resource edited

  String classes[] = {""};
  try {
      classes = rr.getClassHierarchy();
  } catch (RemoteAccessException ex) {
      // big trouble but it may be temporary and this information
      // is not vital, so just warn
      ex.printStackTrace();
  }
View Full Code Here

         Attribute a,
         Object o,
         Properties p)
  throws RemoteAccessException
    {
  RemoteResource r = w.getResource();
  if(o == null) {
      Class v = (Class) r.getValue(a.getName());
      if(v == null)
    if(a.getDefault() != null)
        v = (Class)a.getDefault();
      if ( v != null ) {
    origs = v;
View Full Code Here

    public void initialize(RemoteResourceWrapper w, Attribute a, Object o,
         Properties p)
  throws RemoteAccessException
    {
  RemoteResource r = w.getResource();
  if(o == null) {
      if(a instanceof BooleanAttribute) {
    Object oo = r.getValue(a.getName());
    if(oo != null) {
        origb = ((Boolean)oo).booleanValue();
    } else {
        if(a.getDefault() != null) {
      origb = ((Boolean)a.getDefault()).booleanValue();
View Full Code Here

         Attribute a,
         Object o,
         Properties p)
  throws RemoteAccessException
    {
  RemoteResource r = w.getResource();
  if(o == null) {
      Class v = null;
      // FIXME
      v = (Class) r.getValue(a.getName());
    
      if(v == null)
    if(a.getDefault() != null)
        v = (Class)a.getDefault();
      if ( v != null ) {
View Full Code Here

     */
    public void initialize(RemoteResourceWrapper w, Attribute a,  Object o,
         Properties p)
  throws RemoteAccessException
    {
  RemoteResource r = w.getResource();
  if(o == null) {
      Integer i = null;
      // FIXME
      i = (Integer) r.getValue(a.getName());

      if(i == null)
    if(a.getDefault() != null)
        i = (Integer) a.getDefault();
      if ( i != null ) {
View Full Code Here

         Properties p)
  throws RemoteAccessException
    {
  frame = ((org.w3c.jigadmin.RemoteResourceWrapper)
     w).getServerBrowser().getFrame();
  RemoteResource r = w.getResource();
  name = (String) r.getValue("identifier");
  if(o == null) {
      String v = null;
      v = (String) r.getValue(a.getName());
      if(v == null)
    if(a.getDefault() != null)
        v = a.getDefault().toString();
      if ( v != null ) {
    origs = v;
View Full Code Here

    public void initialize(RemoteResourceWrapper w, Attribute a,  Object o,
         Properties p)
  throws RemoteAccessException
    {
  RemoteResource r = w.getResource();
  if(o == null) {
      String v = (String) r.getValue(a.getName());
      if(v == null)
    if(a.getDefault() != null)
        v = a.getDefault().toString();
      if ( v != null ) {
    origs = v;
View Full Code Here

  getFrame(this).setCursor(new Cursor(cursor));
  Toolkit.getDefaultToolkit().sync();
    }

    protected void open(AdminContext ac) {
  RemoteResource rr = null;
  admin   = ac;
  locked = false;
  boolean authorized = false;

  if (rootResource != null)
View Full Code Here

  new UrlPopup("Open Admin Server : ", this, frame, false);
    }

    public ServerBrowser(AdminContext ac, TreeListener tl) {
  boolean authorized = false;
  RemoteResource rr = null;
  PropertyManager pm = PropertyManager.getPropertyManager();
  admin   = ac;
  this.tl = tl;

  locked = false;
View Full Code Here

TOP

Related Classes of org.w3c.jigsaw.admin.RemoteResource

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.