Creates the menu entry for a single element view.<p>

@param elementView the element view
@param isActive if the group is the currently active group
@param handler the menu handler

@return the menu entry
968942
private CmsContextMenuEntry createMenuEntryForElementView(
        final CmsElementViewInfo elementView,
        boolean isActive,
        I_CmsContextMenuHandler handler) {

        CmsContextMenuEntry menuEntry = new CmsContextMenuEntry(handler, null, new I_CmsContextMenuCommand() {

            public void execute(
                CmsUUID innerStructureId,
                I_CmsContextMenuHandler innerHandler,
                CmsContextMenuEntryBean bean) {

                setElementView(elementView, null);
            }

            public A_CmsContextMenuItem getItemWidget(
                CmsUUID innerStructureId,
                I_CmsContextMenuHandler innerHandler,
                CmsContextMenuEntryBean bean) {

                return null;
            }

            public boolean hasItemWidget() {

                return false;
            }
        });
        CmsContextMenuEntryBean bean = new CmsContextMenuEntryBean();
        bean.setLabel(elementView.getTitle());

        I_CmsInputCss inputCss = I_CmsInputLayoutBundle.INSTANCE.inputCss();
        bean.setIconClass(isActive ? inputCss.checkBoxImageChecked() : "");
        bean.setActive(!isActive);
        bean.setVisible(true);
        menuEntry.setBean(bean);
        return menuEntry;

    }
533346
private static function getElementBySelector(HTMLHandlerInterface $handler, DOMElement $container, $selector)
    {
        try {
            return $handler->select($container->ownerDocument, $selector, $container)->item(0);
        } catch (SyntaxErrorException $ex) {
            // Do nothing
        } catch (InternalErrorException $ex) {
            // Do nothing
        }

        return null;
    }
1117455
@Override
	public final void channelActive(ChannelHandlerContext ctx) throws Exception {
		JConnection connection=buildConnection(ctx);
		listener.connectionOpened(connection);
		super.channelActive(ctx);
	}
847061
public CmsSelectBox createViewSelectorForGalleryDialog() {

        List<CmsElementViewInfo> elementViews = m_controller.getData().getElementViews();
        if (elementViews.size() <= 1) {
            return null;
        }
        CmsUUID currentView = m_controller.getElementView().getElementViewId();
        Map<String, String> options = Maps.newHashMap();
        for (CmsElementViewInfo view : elementViews) {
            options.put("" + view.getElementViewId(), view.getTitle());
        }
        CmsSelectBox result = new CmsSelectBox(options);
        result.setFormValueAsString(currentView.toString());
        result.addValueChangeHandler(new ValueChangeHandler<String>() {

            public void onValueChange(ValueChangeEvent<String> event) {

                m_editor.getAdd().setActive(false);
                CmsElementViewInfo newValue = m_controller.getView(event.getValue());
                setElementView(newValue, new Runnable() {

                    public void run() {

                        m_editor.getAdd().setActive(true);
                    }
                });
            }
        });
        result.getElement().getStyle().setWidth(250, Unit.PX);

        return result;
    }
468942
@Override
  public void channelActive(final ChannelHandlerContext ctx) throws Exception {
    controlSettings = dcpControl.getControls(getServerVersion(ctx.channel())).entrySet().iterator();
    negotiate(ctx);
  }
1003751
function UMLInteractionOperandView() {
        NodeView.apply(this, arguments);
        this.selectable = Core.SK_YES;
        this.movable = Core.MM_NONE;
        this.sizable = Core.SZ_VERT;
        this.parentStyle = true;
        this.minHeight = 15;
        this.height = 30;

        /** @member {LabelView} */
        this.guardLabel = new LabelView();
        this.addSubView(this.guardLabel);
    }
419356
def add_view(self, view_name, handler):
        
        # 如果不是BaseHandler的子类则不加入
        if is_subclass(handler, BaseHandler):
            self.views.append((view_name, handler))
701347
private View getViewOnAbsListLine(AbsListView absListView, int index, int lineIndex){
		final long endTime = SystemClock.uptimeMillis() + Timeout.getSmallTimeout();
		View view = absListView.getChildAt(lineIndex);

		while(view == null){
			final boolean timedOut = SystemClock.uptimeMillis() > endTime;
			if (timedOut){
				Assert.fail("View is null and can therefore not be clicked!");
			}
			
			sleeper.sleep();
			absListView = (AbsListView) viewFetcher.getIdenticalView(absListView);

			if(absListView == null){
				absListView = waiter.waitForAndGetView(index, AbsListView.class);
			}
			
			view = absListView.getChildAt(lineIndex);
		}
		return view;
	}
278800
function getAndActive (router, el, isParent, autoTitle) {
  el = getNode(el);

  var links = findAll(el, 'a');
  var hash = router.toURL(router.getCurrentPath());
  var target;

  links
    .sort(function (a, b) { return b.href.length - a.href.length; })
    .forEach(function (a) {
      var href = a.getAttribute('href');
      var node = isParent ? a.parentNode : a;

      if (hash.indexOf(href) === 0 && !target) {
        target = a;
        toggleClass(node, 'add', 'active');
      } else {
        toggleClass(node, 'remove', 'active');
      }
    });

  if (autoTitle) {
    $.title = target ? ((target.innerText) + " - " + title) : title;
  }

  return target
}
291381
public static void toSAX(Node root, SAXDelegate handler) throws SAXException{
        DOMLocator locator = new DOMLocator();

        switch(root.getNodeType()){
            case Node.DOCUMENT_NODE:
                break;
            case Node.ELEMENT_NODE:
                handler.setDocumentLocator(locator);
                handler.startDocument();
                if(root.getParentNode()!=null){
                    DOMNamespaceContext.Iterator iter = new DOMNamespaceContext.Iterator(root.getParentNode());
                    while(iter.hasNext())
                        handler.startPrefixMapping(iter.next(), iter.getNamespaceURI());
                }
                break;
            default:
                throw new IllegalArgumentException("Node must be Document or Element");
        }

        Node node = root;
        AttributesImpl attrs = new AttributesImpl();
        while(node!=null){
            locator.node = node;
            switch(node.getNodeType()){
                case Node.DOCUMENT_NODE:
                    handler.setDocumentLocator(locator);
                    handler.startDocument();
                    break;
                case Node.DOCUMENT_TYPE_NODE:
                    DocumentType docType = (DocumentType)node;
                    handler.startDTD(docType.getName(), docType.getPublicId(), docType.getSystemId());
                    break;
                case Node.ELEMENT_NODE:
                    attrs.clear();
                    NamedNodeMap nodeAttrs = node.getAttributes();
                    if(nodeAttrs!=null){
                        for(int i=nodeAttrs.getLength()-1; i>=0; i--){
                            Node attr = nodeAttrs.item(i);
                            if(XMLNS_ATTRIBUTE.equals(attr.getNodeName()))
                                handler.startPrefixMapping("", attr.getNodeValue());
                            else if(XMLNS_ATTRIBUTE.equals(attr.getPrefix()))
                                handler.startPrefixMapping(attr.getLocalName(), attr.getNodeValue());
                            else
                                attrs.addAttribute(attr.getNamespaceURI(), attr.getLocalName(), attr.getNodeName(), "CDATA", attr.getNodeValue());
                        }
                    }
                    handler.startElement(node.getNamespaceURI(), node.getLocalName(), node.getNodeName(), attrs);
                    break;
                case Node.TEXT_NODE:
                    char chars[] = node.getNodeValue().toCharArray();
                    handler.characters(chars, 0, chars.length);
                    break;
                case Node.CDATA_SECTION_NODE:
                    chars = node.getNodeValue().toCharArray();
                    handler.startCDATA();
                    handler.characters(chars, 0, chars.length);
                    handler.endCDATA();
                    break;
                case Node.PROCESSING_INSTRUCTION_NODE:
                    ProcessingInstruction pi = (ProcessingInstruction)node;
                    handler.processingInstruction(pi.getTarget(), pi.getData());
                    break;
                case Node.COMMENT_NODE:
                    chars = node.getNodeValue().toCharArray();
                    handler.comment(chars, 0, chars.length);
            }
            NodeList children = node.getChildNodes();
            if(children!=null && children.getLength()>0)
                node = children.item(0);
            else{
                while(true){
                    locator.node = node;
                    switch(node.getNodeType()){
                        case Node.ELEMENT_NODE:
                            handler.endElement(node.getNamespaceURI(), node.getLocalName(), node.getNodeName());
                            NamedNodeMap nodeAttrs = node.getAttributes();
                            if(nodeAttrs!=null){
                                for(int i=nodeAttrs.getLength()-1; i>=0; i--){
                                    Node attr = nodeAttrs.item(i);
                                    if(XMLNS_ATTRIBUTE.equals(attr.getNodeName()))
                                        handler.endPrefixMapping("");
                                    else if(XMLNS_ATTRIBUTE.equals(attr.getPrefix()))
                                        handler.endPrefixMapping(attr.getLocalName());
                                }
                            }
                            break;
                        case Node.DOCUMENT_TYPE_NODE:
                            handler.endDTD();
                            break;
                    }
                    if(node==root){
                        if(root.getNodeType()==Node.ELEMENT_NODE && root.getParentNode()!=null){
                            DOMNamespaceContext.Iterator iter = new DOMNamespaceContext.Iterator(root.getParentNode());
                            while(iter.hasNext())
                                handler.endPrefixMapping(iter.next());
                        }
                        handler.endDocument();
                        return;
                    }
                    if(node.getNextSibling()!=null){
                        node = node.getNextSibling();
                        break;
                    }else
                        node = node.getParentNode();
                }
            }
        }
    }
536838
public void setActive(boolean active, String reason) {

        if (!active) {
            m_clickRegistration.removeHandler();
            m_mouseOutRegistration.removeHandler();
            m_mouseOverRegistration.removeHandler();
            getElement().addClassName(I_CmsLayoutBundle.INSTANCE.contextmenuCss().disabled());
            getElement().setAttribute("title", reason);
        } else {
            addMouseOutHandler(this);
            addMouseOverHandler(this);
            addClickHandler(this);
            getElement().removeClassName(I_CmsLayoutBundle.INSTANCE.contextmenuCss().disabled());
        }
        m_active = active;
    }
63441
private I_CmsFormWidget createTemplateSelector() {

        if (m_handler.useAdeTemplates()) {

            CmsSelectBox selectBox = null;
            Map<String, String> values = new LinkedHashMap<String, String>();
            for (Map.Entry<String, CmsClientTemplateBean> templateEntry : m_handler.getPossibleTemplates().entrySet()) {
                CmsClientTemplateBean template = templateEntry.getValue();
                String title = template.getTitle();
                if ((title == null) || (title.length() == 0)) {
                    title = template.getSitePath();
                }
                values.put(template.getSitePath(), title);
            }
            selectBox = new CmsPropertySelectBox(values);
            return selectBox;
        } else {
            CmsTextBox textbox = new CmsTextBox();
            return textbox;
        }
    }
128089
@Override
  public void channelActive(final ChannelHandlerContext ctx) throws Exception {
    this.channelGroup.add(ctx.channel());
    this.listener.channelActive(ctx);
    super.channelActive(ctx);
  }
979679
function bindToClick(selector, handler) {
    var elems = document.querySelectorAll(selector);
    var i = -1;
    var len = elems.length;
    while (++i < len) {
      elems[i].addEventListener('click', handler);
    }
  }
1044146
@Override
  public void channelInactive(final ChannelHandlerContext ctx) throws Exception {
    this.listener.channelInactive(ctx);
    super.channelInactive(ctx);
  }
585781
@Api
	public final HandlerRegistration addFeatureSelectionHandler(final FeatureSelectionHandler handler) {
		return handlerManager.addHandler(FeatureSelectionHandler.TYPE, handler);
	}
1233827
public void actionPerformed(ActionEvent ev) {

        String s = ev.getActionCommand();

        if (s == null) {
            if (ev.getSource() instanceof MenuItem) {
                MenuItem i;

                s = ((MenuItem) ev.getSource()).getLabel();
            }
        }

        if (s.equals("Execute")) {
            execute();
            layoutCard.show(pCard, "result");
        } else if (s.equals("Tree")) {
            layoutCard.show(pCard, "tree");
        } else if (s.equals("Command")) {
            layoutCard.show(pCard, "command");
        } else if (s.equals("Result")) {
            layoutCard.show(pCard, "result");
        } else if (s.equals("Editor")) {
            layoutCard.show(pCard, "editor");
        } else if (s.equals("Exit")) {
            windowClosing(null);
        } else if (s.equals("Logging on")) {
            JavaSystem.setLogToSystem(true);
        } else if (s.equals("Logging off")) {
            JavaSystem.setLogToSystem(false);
        } else if (s.equals("Refresh Tree")) {
            refreshTree();
            layoutCard.show(pCard, "tree");
        } else if (s.startsWith("#")) {
            int i = Integer.parseInt(s.substring(1));

            txtCommand.setText(sRecent[i]);
        } else if (s.equals("Connect...")) {
            connect(ZaurusConnectionDialog.createConnection(fMain, "Connect",
                    new Insets(defWidth, defHeight, defLocX, defLocY)));
            refreshTree();
            layoutCard.show(pCard, "tree");
        } else if (s.equals("View Tree")) {
            layoutCard.show(pCard, "tree");
        } else if (s.equals("View Command")) {
            layoutCard.show(pCard, "command");
        } else if (s.equals("View Result")) {
            layoutCard.show(pCard, "result");
        } else if (s.equals("View Editor")) {
            layoutCard.show(pCard, "editor");
        } else if (s.equals("Results in Grid")) {
            iResult = 0;

            pResult.removeAll();
            pResult.add("Center", gResult);
            pResult.doLayout();
            layoutCard.show(pCard, "result");
        } else if (s.equals("Open Script...")) {
            FileDialog f = new FileDialog(fMain, "Open Script",
                                          FileDialog.LOAD);

            // (ulrivo): set default directory if set from command line
            if (defDirectory != null) {
                f.setDirectory(defDirectory);
            }

            f.show();

            String file = f.getFile();

            if (file != null) {
                txtCommand.setText(
                    DatabaseManagerCommon.readFile(f.getDirectory() + file));
            }

            layoutCard.show(pCard, "command");
        } else if (s.equals("Save Script...")) {
            FileDialog f = new FileDialog(fMain, "Save Script",
                                          FileDialog.SAVE);

            // (ulrivo): set default directory if set from command line
            if (defDirectory != null) {
                f.setDirectory(defDirectory);
            }

            f.show();

            String file = f.getFile();

            if (file != null) {
                DatabaseManagerCommon.writeFile(f.getDirectory() + file,
                                                txtCommand.getText());
            }
        } else if (s.equals("Save Result...")) {
            FileDialog f = new FileDialog(fMain, "Save Result",
                                          FileDialog.SAVE);

            // (ulrivo): set default directory if set from command line
            if (defDirectory != null) {
                f.setDirectory(defDirectory);
            }

            f.show();

            String file = f.getFile();

            if (file != null) {
                showResultInText();
                DatabaseManagerCommon.writeFile(f.getDirectory() + file,
                                                txtResult.getText());
            }
        } else if (s.equals("Results in Text")) {
            iResult = 1;

            pResult.removeAll();
            pResult.add("Center", txtResult);
            pResult.doLayout();
            showResultInText();
            layoutCard.show(pCard, "result");
        } else if (s.equals("AutoCommit on")) {
            try {
                cConn.setAutoCommit(true);
            } catch (SQLException e) {}
        } else if (s.equals("AutoCommit off")) {
            try {
                cConn.setAutoCommit(false);
            } catch (SQLException e) {}
        } else if (s.equals("Commit")) {
            try {
                cConn.commit();
            } catch (SQLException e) {}
        } else if (s.equals("Insert test data")) {
            insertTestData();
            layoutCard.show(pCard, "result");
        } else if (s.equals("Rollback")) {
            try {
                cConn.rollback();
            } catch (SQLException e) {}
        } else if (s.equals("Disable MaxRows")) {
            try {
                sStatement.setMaxRows(0);
            } catch (SQLException e) {}
        } else if (s.equals("Set MaxRows to 100")) {
            try {
                sStatement.setMaxRows(100);
            } catch (SQLException e) {}
        } else if (s.equals("SELECT")) {
            showHelp(DatabaseManagerCommon.selectHelp);
        } else if (s.equals("INSERT")) {
            showHelp(DatabaseManagerCommon.insertHelp);
        } else if (s.equals("UPDATE")) {
            showHelp(DatabaseManagerCommon.updateHelp);
        } else if (s.equals("DELETE")) {
            showHelp(DatabaseManagerCommon.deleteHelp);
        } else if (s.equals("CREATE TABLE")) {
            showHelp(DatabaseManagerCommon.createTableHelp);
        } else if (s.equals("DROP TABLE")) {
            showHelp(DatabaseManagerCommon.dropTableHelp);
        } else if (s.equals("CREATE INDEX")) {
            showHelp(DatabaseManagerCommon.createIndexHelp);
        } else if (s.equals("DROP INDEX")) {
            showHelp(DatabaseManagerCommon.dropIndexHelp);
        } else if (s.equals("CHECKPOINT")) {
            showHelp(DatabaseManagerCommon.checkpointHelp);
        } else if (s.equals("SCRIPT")) {
            showHelp(DatabaseManagerCommon.scriptHelp);
        } else if (s.equals("SHUTDOWN")) {
            showHelp(DatabaseManagerCommon.shutdownHelp);
        } else if (s.equals("SET")) {
            showHelp(DatabaseManagerCommon.setHelp);
        } else if (s.equals("Test Script")) {
            showHelp(DatabaseManagerCommon.testHelp);
        } else if (s.equals("Show HTML-Help in browser")) {
            try {
                System.out.println("Starting Opera on index.html");
                Runtime.getRuntime().exec(new String[] {
                    "opera", "/home/QtPalmtop/help/html/hsqldb/index.html"
                });
            } catch (IOException e) {
                System.out.println("A problem with Opera occured.");
            }
        }
    }