/** * Get the mechanism info for the gui. */ public MechanismInfo getMechanismInfo() { List<ParameterInfo> params = new ArrayList<ParameterInfo>(); params.add(new ParameterInfo("verify", "If turned on, the ttp is verify (its certificate must be in local keystore)", boolean.class, verify)); params.add(new ParameterInfo("ttpcid", "The component identifier (or name) of the trusted third party", IComponentIdentifier.class, ttpcid)); MechanismInfo ret = new MechanismInfo("Trusted Third Party", getClass(), params); return ret; }
/** * Create checkbox for boolean choices. */ protected void createCheckBox(PropertiesPanel pp, final ParameterInfo pi, final MechanismInfo mi) { final JCheckBox cb = pp.createCheckBox(pi.getName(), ((Boolean)pi.getValue()).booleanValue(), true); cb.setToolTipText(pi.getDescription()); cb.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { AcquireCertificatePanel.this.secser.setAcquisitionMechanismParameterValue(mi.getClazz(), pi.getName(), cb.isSelected()? Boolean.TRUE: Boolean.FALSE); } }); updateactions.put(mi.getClazz().getName()+"."+pi.getName(), new ICommand<Object>() { public void execute(Object val) { cb.setSelected(((Boolean)val).booleanValue()); } }); }
public void run() { Object val = tf.getText(); Class<?> cl = pi.getType(); if(!String.class.equals(cl)) { IStringObjectConverter conv = BasicTypeConverter.getBasicStringConverter(cl); if(conv==null) // todo: return; try { val = conv.convertString((String)val, null); } catch(Exception ex) { throw new RuntimeException(ex); } } AcquireCertificatePanel.this.secser.setAcquisitionMechanismParameterValue(mi.getClazz(), pi.getName(), val); } };
public void actionPerformed(ActionEvent e) { AcquireCertificatePanel.this.secser.setAcquisitionMechanismParameterValue(mi.getClazz(), pi.getName(), cb.isSelected()? Boolean.TRUE: Boolean.FALSE); } });
public void execute(Object val) { Class<?> cl = pi.getType(); if(!String.class.equals(cl)) { IObjectStringConverter conv = BasicTypeConverter.getBasicObjectConverter(cl); if(conv!=null) { try { val = conv.convertObject(val, null); } catch(Exception ex) { throw new RuntimeException(ex); } } } tf.setText(""+val); } });
public void run() { Object val = tf.getText(); Class<?> cl = pi.getType(); if(!String.class.equals(cl)) { IStringObjectConverter conv = BasicTypeConverter.getBasicStringConverter(cl); if(conv==null) // todo: return; try { val = conv.convertString((String)val, null); } catch(Exception ex) { throw new RuntimeException(ex); } } AcquireCertificatePanel.this.secser.setAcquisitionMechanismParameterValue(mi.getClazz(), pi.getName(), val); } };
public void actionPerformed(ActionEvent e) { AcquireCertificatePanel.this.secser.setAcquisitionMechanismParameterValue(mi.getClazz(), pi.getName(), cb.isSelected()? Boolean.TRUE: Boolean.FALSE); } });
public void execute(Object val) { Class<?> cl = pi.getType(); if(!String.class.equals(cl)) { IObjectStringConverter conv = BasicTypeConverter.getBasicObjectConverter(cl); if(conv!=null) { try { val = conv.convertObject(val, null); } catch(Exception ex) { throw new RuntimeException(ex); } } } tf.setText(""+val); } });
/** * Create checkbox for boolean choices. */ protected void createCheckBox(PropertiesPanel pp, final ParameterInfo pi, final MechanismInfo mi) { final JCheckBox cb = pp.createCheckBox(pi.getName(), ((Boolean)pi.getValue()).booleanValue(), true); cb.setToolTipText(pi.getDescription()); cb.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { AcquireCertificatePanel.this.secser.setAcquisitionMechanismParameterValue(mi.getClazz(), pi.getName(), cb.isSelected()? Boolean.TRUE: Boolean.FALSE); } }); updateactions.put(mi.getClazz().getName()+"."+pi.getName(), new ICommand<Object>() { public void execute(Object val) { cb.setSelected(((Boolean)val).booleanValue()); } }); }
public void run() { String name = tf.getText(); IComponentIdentifier cid = name.length()>0? new BasicComponentIdentifier(name): null; AcquireCertificatePanel.this.secser.setAcquisitionMechanismParameterValue(mi.getClazz(), pi.getName(), cid); } }, tf);
/** * Get the mechanism info for the gui. */ public MechanismInfo getMechanismInfo() { List<ParameterInfo> params = new ArrayList<ParameterInfo>(); params.add(new ParameterInfo("verify", "If turned on, the ttp is verify (its certificate must be in local keystore)", boolean.class, verify)); params.add(new ParameterInfo("ttpcid", "The component identifier (or name) of the trusted third party", IComponentIdentifier.class, ttpcid)); MechanismInfo ret = new MechanismInfo("Trusted Third Party", getClass(), params); return ret; }
for(final ParameterInfo pi: pis) Class<?> tcl = pi.getType(); if(boolean.class.equals(tcl) || Boolean.class.equals(tcl))
final JTextField tf = pp.createTextField(pi.getName(), pi.getValue()==null? "": ""+pi.getValue(), true); tf.setToolTipText(pi.getDescription()); final Runnable action = new Runnable() addTextFieldListener(action, tf); updateactions.put(mi.getClazz().getName()+"."+pi.getName(), new ICommand<Object>()
public void run() { String name = tf.getText(); IComponentIdentifier cid = name.length()>0? new ComponentIdentifier(name): null; AcquireCertificatePanel.this.secser.setAcquisitionMechanismParameterValue(mi.getClazz(), pi.getName(), cid); } }, tf);
/** * Get the mechanism info for the gui. */ public MechanismInfo getMechanismInfo() { List<ParameterInfo> params = new ArrayList<ParameterInfo>(); params.add(new ParameterInfo("responses", "Number of evaluated certificate responses " + "(must all be equal, use 1 for bootstrapping, use <1 to disable)", int.class, Integer.valueOf(responses))); MechanismInfo ret = new MechanismInfo("Decentralized", getClass(), params); return ret; }
for(final ParameterInfo pi: pis) Class<?> tcl = pi.getType(); if(boolean.class.equals(tcl) || Boolean.class.equals(tcl))
final JTextField tf = pp.createTextField(pi.getName(), pi.getValue()==null? "": ""+pi.getValue(), true); tf.setToolTipText(pi.getDescription()); final Runnable action = new Runnable() addTextFieldListener(action, tf); updateactions.put(mi.getClazz().getName()+"."+pi.getName(), new ICommand<Object>()
public void actionPerformed(ActionEvent e) { IComponentIdentifier cid = csd.selectAgent(null); if(cid!=null) { // tf.setText(cid.getName()); AcquireCertificatePanel.this.secser.setAcquisitionMechanismParameterValue(mi.getClazz(), pi.getName(), cid); } } });
/** * Get the mechanism info for the gui. */ public MechanismInfo getMechanismInfo() { List<ParameterInfo> params = new ArrayList<ParameterInfo>(); params.add(new ParameterInfo("responses", "Number of evaluated certificate responses " + "(must all be equal, use 1 for bootstrapping, use <1 to disable)", int.class, Integer.valueOf(responses))); MechanismInfo ret = new MechanismInfo("Decentralized", getClass(), params); return ret; }
tf.setToolTipText(pi.getDescription()); final JButton bu = new JButton("..."); if(pi.getValue()!=null) tf.setText(((IComponentIdentifier)pi.getValue()).getPlatformPrefix()); p.add(bu, BorderLayout.EAST); pp.addComponent(pi.getName(), p); updateactions.put(mi.getClazz().getName()+"."+pi.getName(), new ICommand<Object>()