Examples of Action


Examples of org.brixcms.auth.Action

                    }

                    @Override
                    public boolean isVisible() {
                        Workspace target = ManageSnapshotsPanel.this.getModelObject();
                        Action action = new RestoreSnapshotAction(Context.ADMINISTRATION, item
                                .getModelObject(), target);
                        return getBrix().getAuthorizationStrategy().isActionAuthorized(action);
                    }
                };

                /*
                 * in case the link is enabled, make sure it is intended...
                 */
                if (restoreLink.isEnabled()) {
                    restoreLink.add(new SimpleAttributeModifier("onClick", "return confirm('" + getLocalizer().getString("restoreOnClick", this) + "')"));
                }

                item.add(restoreLink);

                item.add(new Link<Void>("delete") {
                    @Override
                    public void onClick() {
                        Workspace snapshot = item.getModelObject();
                        snapshot.delete();
                    }

                    @Override
                    public boolean isVisible() {
                        Action action = new DeleteSnapshotAction(Context.ADMINISTRATION, item
                                .getModelObject());
                        return getBrix().getAuthorizationStrategy().isActionAuthorized(action);
                    }
                });

                item.add(new Label("label", name));

                item.add(new Label("commentlabel", comment));
            }
        });


        add(new Link<Object>("downloadWorkspace") {
            @Override
            public void onClick() {
                getRequestCycle().scheduleRequestHandlerAfterCurrent(new IRequestHandler() {
                    public void detach(IRequestCycle requestCycle) {
                    }

                    public void respond(IRequestCycle requestCycle) {
                        WebResponse resp = (WebResponse) requestCycle.getResponse();
                        resp.setAttachmentHeader("workspace.xml");
                        String id = ManageSnapshotsPanel.this.getModelObject().getId();
                        Brix brix = getBrix();
                        JcrSession session = brix.getCurrentSession(id);
                        HttpServletResponse containerResponse = (HttpServletResponse) resp.getContainerResponse();
                        ServletOutputStream containerResponseOutputStream = null;
                        try {
                            containerResponseOutputStream = containerResponse.getOutputStream();
                        }
                        catch (IOException e) {
                            throw new RuntimeException(e);
                        }
                        session.exportSystemView(brix.getRootPath(), containerResponseOutputStream, false, false);
                    }
                });
            }
        });

        /**
         * Form to create a new Snapshot and put any comment to it
         */
        Form<Object> commentForm = new Form<Object>("commentForm") {
            @Override
            public boolean isVisible() {
                Workspace target = ManageSnapshotsPanel.this.getModelObject();
                Action action = new CreateSnapshotAction(Context.ADMINISTRATION, target);
                return getBrix().getAuthorizationStrategy().isActionAuthorized(action);
            }
        };

        final TextArea<String> area = new TextArea<String>("area", new Model<String>());
        commentForm.add(area);

        commentForm.add(new SubmitLink("createSnapshot") {
            /**
             * @see org.apache.wicket.markup.html.form.IFormSubmittingComponent#onSubmit()
             */
            @Override
            public void onSubmit() {
                String comment = area.getModelObject();
                SnapshotPlugin.get().createSnapshot(ManageSnapshotsPanel.this.getModelObject(), comment);
                area.setModelObject("");
            }
        });
        add(commentForm);


        Form<Object> uploadForm = new Form<Object>("uploadForm") {
            @Override
            public boolean isVisible() {
                Workspace target = ManageSnapshotsPanel.this.getModelObject();
                Action action = new RestoreSnapshotAction(Context.ADMINISTRATION, target);
                return getBrix().getAuthorizationStrategy().isActionAuthorized(action);
            }
        };

        final FileUploadField upload = new FileUploadField("upload", new Model());
View Full Code Here

Examples of org.bukkit.event.block.Action

    public void onPlayerInteract(PlayerInteractEvent event) {
        Player p = event.getPlayer();
        if (!arena.inLobby(p)) return;

        // Player is in the lobby, so disallow using items.
        Action a = event.getAction();
        if (a == Action.RIGHT_CLICK_AIR || a == Action.RIGHT_CLICK_BLOCK) {
            event.setUseItemInHand(Result.DENY);
            event.setCancelled(true);
        }
View Full Code Here

Examples of org.codehaus.plexus.action.Action

    protected void executeAction( String actionName, Map<String, Object> context )
        throws ContinuumException
    {
        try
        {
            Action action = actionManager.lookup( actionName );

            action.execute( context );
        }
        catch ( ActionNotFoundException e )
        {
            e.printStackTrace();
            throw new ContinuumException( "Error while executing the action '" + actionName + "'.", e );
View Full Code Here

Examples of org.controlsfx.control.action.Action

        return modalDialog;
    }

    public void exitApp() {

        Action response = Dialogs.create()
                .owner(getPrimaryStage())
                .message(getResourceBundle().getString("app.dialog.confirm.exitapp.message"))
                .nativeTitleBar()
                .actions(new Action[]{Dialog.Actions.YES, Dialog.Actions.NO})
                .showConfirm();
View Full Code Here

Examples of org.cybergarage.upnp.Action

      ser.setEventSubURL(id+"/service/"+i+"/event");

      UPnPAction[] actions = services[i].getActions();
      for (int j = 0; j < actions.length; j++) {
                boolean valid=true;
        Action act = new Action(ser.getServiceNode());
        act.setName(actions[j].getName());
        ArgumentList al = new ArgumentList();
       
        String[] names=actions[j].getInputArgumentNames();       
        if(names!=null){
          for (int k = 0; k < names.length; k++) {
                        UPnPStateVariable variable = actions[j].getStateVariable(names[k]);
                        if(variable==null){
                            /*
                             * //TODO Create a stict and relaxed behavior of the base driver which
                             * export as much it can or export only 100% complaint UPnPDevice service
                             */
                            Activator.logger.WARNING(
                                "UPnP Device that cotains serviceId="+id+" contains the action "
                                +actions[j].getName()+" with the Input argument "+names[k]
                                +" not related to any UPnPStateVariable. Thus this action won't be exported");
                            valid=false;
                            break;
                        }
                        Argument a = new Argument();
            a.setDirection(Argument.IN);
            a.setName(names[k]);
            a.setRelatedStateVariableName(variable.getName());           
            al.add(a);           
          }
        }
        names=actions[j].getOutputArgumentNames();
        if(names!=null && valid){
          for (int k = 0; k < names.length; k++) {
                        UPnPStateVariable variable = actions[j].getStateVariable(names[k]);
                        if(variable==null){
                            /*
                             * //TODO Create a stict and relaxed behavior of the base driver which
                             * export as much it can or export only 100% complaint UPnPDevice service
                             */
                            Activator.logger.WARNING(
                                "UPnP Device that cotains serviceId="+id+" contains the action "
                                +actions[j].getName()+" with the Output argument "+names[k]
                                +" not related to any UPnPStateVariable. Thus this action won't be exported");                           
                        }
            Argument a = new Argument();
            a.setDirection(Argument.OUT);
            a.setName(names[k]);
            a.setRelatedStateVariableName(variable.getName());           
            al.add(a);           
          }
        }
                if(valid) {
            act.setArgumentList(al);
            ser.addAction(act);
                }
      }     
     
      UPnPStateVariable[] vars = services[i].getStateVariables();
View Full Code Here

Examples of org.destecs.core.scenario.Action

  {
    super.beforeStep(nextStepEngine, nextTime, dtProxy, ctProxy, inputs, singleStep,events);

    while (!actions.isEmpty() && actions.peek().time <= nextTime)
    {
      Action action = actions.poll();
      switch (action.targetSimulator)
      {
        case ALL:
          break;
        case CT:
View Full Code Here

Examples of org.deuce.transaction.tl2cm.cm.ContentionManager.Action

            // un-registered its context object. In this case, I retry.
            //trace("Lock owner is not available, probably already finished. Retrying lock #{0}", new Object[]{lockedCounter});
            continue;
          }
          else {
            Action action = cm.resolve(writeField, this, otherCtx);
            if (action == Action.RESTART) {
              // this will cause my transaction to roll-back and restart itself
              //trace("restarting transaction as a result of contention on lock #{0}", new Object[]{lockedCounter});
              kill(-1);
              break;
View Full Code Here

Examples of org.dmd.mvw.client.mvwmenus.base.Action

  public void initializeMenus() {
    // By now, everyone has registered their stuff, so start building the
    // menu structure - first, assign actions to the menu items and, while
    // we're at it, add the items to their menus
    for(MvwMenuItem mii : menuItems.values()){
      Action action = actions.get(mii.getActionName());
      mii.setAction(action);
     
      MvwMenu menu = allMenus.get(mii.getAddToMenu());
      menu.addSubItem(mii);
    }
View Full Code Here

Examples of org.dom4j.rule.Action

     */
    protected Stylesheet createStylesheet(final XMLOutput output) {
        // add default actions
        Stylesheet answer = new Stylesheet();
        answer.setValueOfAction(
            new Action() {
                public void run(Node node) throws Exception {                   
                    String text = node.getStringValue();
                    if ( text != null && text.length() > 0 ) {
                        // #### should use an 'output' property
                        // when this variable gets reused
View Full Code Here

Examples of org.drools.runtime.pipeline.Action

public class ListAdapterTest extends TestCase {
    public void testListAdapter() {
        MockClass mock = new MockClass();
        List list = new ArrayList();
       
        Action action = PipelineFactory.newMvelAction( "this.set = true" );  
       
        ListAdapter listAdapter = new ListAdapterImpl( list, true );       
        action.setReceiver( listAdapter );
       
        assertFalse( mock.isSet() );
        action.receive( mock, new BasePipelineContext( Thread.currentThread().getContextClassLoader() ) );

        assertEquals( 1, list.size());
        assertSame( mock, list.get( 0 ) );
        assertTrue( mock.isSet() );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.