Creates an action object from fields.

@param label Action's label name. May be a label reference (prefixed with an '@' character)
or the label itself.
@param script Action's script.
@return An action object.
766838
public static IAction createAction(String label, String script) {
        return new Action(script, label, script);
    }
677848
public void addLabel(Label label)
    {
        // Add the label to any applications it is associated with
        List<Long> applicationIds = label.getLinks().getApplications();
        for(long applicationId : applicationIds)
        {
            Application application = applications.get(applicationId);
            if(application != null)
                labels(applicationId).add(label);
            else
                logger.severe(String.format("Unable to find application for label '%s': %d", label.getKey(), applicationId));
        }
    }
920654
@Override
	public void setLabelMessage(String labelMessage)
	{
		myUserInterfaceAction.setLabelMessage(labelMessage);
		putValue(Action.NAME, myMessageProvider.getMessage(getLabelMessage(), getLocale()));
	}
12031
public static Label newActionLabel (String text, String style, ClickHandler onClick)
    {
        return makeActionLabel(newLabel(text, style), onClick);
    }
874384
public static Label.Builder generateLabelBuilder(final Locale locale, final String label) {
        return addLabel(Label.newBuilder(), locale.getLanguage(), label);
    }
124075
private Object wrappedAction(final Context cx, final Scriptable scope,
			final Scriptable thisObj, final Object[] args, final int actionType) {

		// take care to set the context's RegExp proxy to the original one as
		// this is checked
		// (cf net.sourceforge.htmlunit.corejs.javascript.regexp.RegExpImp:334)
		try {
			ScriptRuntime.setRegExpProxy(cx, wrapped_);
			return wrapped_.action(cx, scope, thisObj, args, actionType);
		} finally {
			ScriptRuntime.setRegExpProxy(cx, this);
		}
	}
732033
public static Label newActionLabel (String text, ClickHandler onClick)
    {
        return newActionLabel(text, null, onClick);
    }
285380
def get_label(self, label, params=None):
        
        return self.label(label, action='GET', params=params)
577006
private Object getScriptResult(String script, ScriptEngine engine) throws ScriptException {
        String scriptToExecute = script.substring(script.indexOf(":") + 1);
        return engine.eval(scriptToExecute);
    }
432374
public static String buildAction(Class<?> clazz, String action) {
        return new StringBuilder().append(clazz.getCanonicalName()).append(".").append(action).toString();
    }
945883
protected String processLabel(String label, String name) {
    if (null != label) {
      if (Strings.isEmpty(label)) return null;
      else return getText(label);
    } else return getText(name);
  }
832527
public static JComponent createTitleLabel(final String text, final ActionListener backButtonActionListener) {
        final DCLabel titleLabel = new DCLabel(false, text, WidgetUtils.BG_COLOR_BLUE_DARK, null);
        titleLabel.setFont(WidgetUtils.FONT_BANNER);

        final EmptyBorder border = new EmptyBorder(adjuster.adjust(20), MARGIN_LEFT, adjuster.adjust(10), 0);

        if (backButtonActionListener != null) {
            titleLabel.addMouseListener(new MouseAdapter() {
                @Override
                public void mouseClicked(final MouseEvent e) {
                    backButtonActionListener.actionPerformed(null);
                }
            });
            titleLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));

            final DCPanel panel = DCPanel.flow(Alignment.LEFT, MARGIN_LEFT, 0,
                    createBackToWelcomeScreenButton(backButtonActionListener), titleLabel);
            panel.setBorder(border);
            return panel;
        } else {
            titleLabel.setBorder(border);
            return titleLabel;
        }
    }
615634
public static Label newLabel(final String id, final String label)
	{
		return ComponentFactory.newLabel(id, Model.of(label));
	}
1158787
def find_label(self, label: Label):
        
        for index, action in enumerate(self.program):
            if isinstance(action, JumpTarget):
                if label == action.label:
                    return index

        raise RuntimeError("Improper program - Jump Target not found in the "
                           "input program!")
105456
def rule_action(label=None, params=None):
    
    def wrapper(func):
        params_ = params
        if isinstance(params, dict):
            params_ = [dict(label=fn_name_to_pretty_label(name),
                           name=name,
                           fieldType=field_type) \
                      for name, field_type in params.items()]
        _validate_action_parameters(func, params_)
        func.is_rule_action = True
        func.label = label \
                or fn_name_to_pretty_label(func.__name__)
        func.params = params_
        return func
    return wrapper
745354
def _create_static_actions(self):
        
        logger.info("Creating static context menu actions.")
        self.action_view_script_error = self._create_action(
            None, "&View script error", self.reset_tray_icon,
            "View the last script error."
        )
        self.action_view_script_error.triggered.connect(self.app.show_script_error)
        # The action should disable itself
        self.action_view_script_error.setDisabled(True)
        self.action_view_script_error.triggered.connect(self.action_view_script_error.setEnabled)
        self.action_hide_icon = self._create_action(
            "edit-clear", "Temporarily &Hide Icon", self.hide,
            "Temporarily hide the system tray icon.\nUse the settings to hide it permanently."
        )
        self.action_show_config_window = self._create_action(
            "configure", "&Show Main Window", self.app.show_configure,
            "Show the main AutoKey window. This does the same as left clicking the tray icon."
        )
        self.action_quit = self._create_action("application-exit", "Exit AutoKey", self.app.shutdown)
        # TODO: maybe import this from configwindow.py ? The exact same Action is defined in the main window.
        self.action_enable_monitoring = self._create_action(
            None, "&Enable Monitoring", self.app.toggle_service,
            "Pause the phrase expansion and script execution, both by abbreviations and hotkeys.\n"
            "The global hotkeys to show the main window and to toggle this setting, as defined in the AutoKey "
            "settings, are not affected and will work regardless."
        )
        self.action_enable_monitoring.setCheckable(True)
        self.action_enable_monitoring.setChecked(self.app.service.is_running())
        self.action_enable_monitoring.setDisabled(self.app.serviceDisabled)
        # Sync action state with internal service state
        self.app.monitoring_disabled.connect(self.action_enable_monitoring.setChecked)
1306781
public Label createLabel(BaseComponent parent, Object value) {
        return createLabel(parent, value, null, null);
    }