Package java.awt

Examples of java.awt.List$State


    @Override
    public CompletionContext<State> buildContext(
        SelectionModel selection, DocumentParser parser) {
      JsonArray<Token> tokens = JsonCollections.createArray();
      State state = TestUtils.createMockState();
      tokens.add(new Token(null, NULL, ""));
      ParseResult<State> parseResult = new ParseResult<State>(tokens, state) {};
      return buildContext(
          new ParseUtils.ExtendedParseResult<State>(parseResult, ParseUtils.Context.IN_CODE));
    }
View Full Code Here


   * @param anchorToUpdate the optional anchor that this method will update
   */
  private boolean parseImplCm2(Line line, int lineNumber, int numLinesToProcess,
      @Nullable Anchor anchorToUpdate, ParsedTokensRecipient tokensRecipient) {

    State parserState = loadParserStateForBeginningOfLine(line);
    if (parserState == null) {
      return false;
    }

    Line previousLine = line.getPreviousLine();

    for (int numLinesProcessed = 0; line != null && numLinesProcessed < numLinesToProcess;) {
      State stateToSave = parserState;
      if (line.getText().length() > LINE_LENGTH_LIMIT) {
        // Save the initial state instead of state at the end of line.
        stateToSave = parserState.copy(codeMirrorParser);
      }

View Full Code Here

    parseImplCm2(line, -1, 1, null, tokensRecipient);
    return tokensRecipient.tokens;
  }

  int getIndentation(Line line) {
    State stateBefore = loadParserStateForBeginningOfLine(line);
    String textAfter = line.getText();
    textAfter = textAfter.substring(StringUtils.lengthOfStartingWhitespace(textAfter));
    return codeMirrorParser.indent(stateBefore, textAfter);
  }
View Full Code Here

   *
   * @return copy of corresponding parser state, or {@code null} if the state
   *         if not known yet (previous line wasn't parsed).
   */
  private <T extends State> T loadParserStateForBeginningOfLine(TaggableLine line) {
    State state;
    if (line.isFirstLine()) {
      state = codeMirrorParser.defaultState();
    } else {
      state = line.getPreviousLine().getTag(LINE_TAG_END_OF_LINE_PARSER_STATE_SNAPSHOT);
      state = (state == null) ? null : state.copy(codeMirrorParser);
    }

    @SuppressWarnings("unchecked")
    T result = (T) state;
    return result;
View Full Code Here

   *
   * @see #loadParserStateForBeginningOfLine
   */
  @Nullable
  String getInitialMode(@Nonnull TaggableLine line) {
    State state = loadParserStateForBeginningOfLine(line);
    if (state == null) {
      return null;
    }
    return codeMirrorParser.getName(state);
  }
View Full Code Here

        toggleFullscreen();
      }
    });
    selectionPanel.add(fullScreen, BorderLayout.SOUTH);

    final List demos = new List();
    for (Enumeration e = selectableDemos.keys(); e.hasMoreElements();) {
      demos.add(e.nextElement().toString());
    }
    selectionPanel.add(demos, BorderLayout.CENTER);

    demos.addItemListener(new ItemListener() {

      public void itemStateChanged(ItemEvent event) {
        demoSelected(event.getItemSelectable().getSelectedObjects()[0].toString());
      }
    });
View Full Code Here

           
            buildCommand( panel, gridBag, c, getRes().getString( "Dump Configuration" ), "configuration",
                    getRes().getString( "Dumps all Wrapper Configuration Properties to the console." ) );
           
           
            m_listenerFlags = new List( 2, true );
            m_listenerFlags.add( "Service" );
            m_listenerFlags.add( "Control" );
            m_listenerFlags.add( "Logging" );
            m_listenerFlags.add( "Core" );
           
View Full Code Here

    public void processInput(BridgeComponentPeer peer, BridgeInputContext context, Map inputForm) throws InputException
    {
        if (hasEvent(peer, inputForm))
        {
            Object indicesObj = inputForm.get(peer.getId());
            List l = (List) peer.getComponentObject();
            BitSet selected = new BitSet(l.getItemCount());
            if (indicesObj instanceof String)
            {
                int i = Integer.parseInt((String) indicesObj);
                selected.set(i, true);
            } else if (indicesObj instanceof Object[])
            {
                Object[] indicesStr = (Object[]) indicesObj;
                for (int i = 0; i < indicesStr.length; i++)
                {
                    int set = Integer.parseInt(indicesStr[i].toString());
                    selected.set(set, true);
                }
            }
            try
            {
                int event = 0;
                for (int i = 0; i < l.getItemCount(); i++)
                {
                    if (selected.get(i))
                    {
                        if (!l.isIndexSelected(i))
                        {
                            event = 1;
                            l.select(i);
                            _logger.finest("made " + i + " selected" + l.isIndexSelected(i));
                        } //else ignore
                    } else //not selected
                    if (l.isIndexSelected(i))
                    {
                        event = -1;
                        l.deselect(i);
                        _logger.finest("made " + i + " deselected " + l.isIndexSelected(i));
                    }
                }
                //the firing of event could be random
                //when there's no listener to this list component
                //because the user could do several selection/deselection
View Full Code Here

    Panel numbersPanel= createCounterPanel();

    //---- fourth section
    Label failureLabel= new Label("Errors and Failures:");

    fFailureList= new List(5);
    fFailureList.addItemListener(
      new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
          failureSelected();
        }
View Full Code Here

  List list;
  boolean refill;

  public ResourceViewer() {
    super("ResourceViewer");
    list = new List();

    setLayout(new BorderLayout());
    add("Center", list);

    Button clearCashButton = new Button("clear the cache");
View Full Code Here

TOP

Related Classes of java.awt.List$State

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.