*********************************************************************************************

TextWatcher Methods
508596
@Override
    public void beforeTextChanged(CharSequence s, int start, int count, int after) {
        for (int i = 0; i < mWatchers.size(); i++) {
            int key = mWatchers.keyAt(i);
            if(mEnabledKeys.get(key)) {
                mWatchers.valueAt(i).beforeTextChanged(s, start, count, after);
            }
        }
    }
495635
@Override
	public void addText(String text)
	{
		if (selectingText)
			deleteSelectedText();

		final StringBuilder oldText = this.password;
		final String oldValue = oldText.toString();
		String newValue = oldText.insert(this.cursor.index, text).toString();

		if (this.filterFunction != null)
			newValue = this.filterFunction.apply(newValue);

		if (!fireEvent(new ComponentEvent.ValueChange<>(this, oldValue, newValue)))
			return;

		this.password = new StringBuilder(newValue);
		this.updateText();
		this.cursor.jumpBy(text.length());
	}
936829
protected void onRPCError(int asyncHandle, int asyncError, String text) {
        IAsyncRPCEvent callback = getCallback(asyncHandle);
        
        if (callback != null) {
            callback.onRPCError(asyncHandle, asyncError, text);
        }
    }
663846
public static void readTextLines(InputStream openRawResource, OnReadLineListener listener) {
		BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(openRawResource));
		String line;		
		try {
			while ((line = bufferedReader.readLine()) != null) {
				listener.onTextLine(line);				
			}
		} catch (IOException e) {
			Logger.error(e.getMessage());
			e.printStackTrace();
		} finally {
			
			if (bufferedReader != null) {
				try {
					bufferedReader.close();
				} catch (IOException e) {
					Logger.error(e.getMessage());
					e.printStackTrace();
				}
			}
			
		}
	}
923988
private TextWatcher createTextChangeListener() {
        return new TextWatcher() {

            @Override
            public final void beforeTextChanged(final CharSequence s, final int start,
                                                final int count, final int after) {

            }

            @Override
            public final void onTextChanged(final CharSequence s, final int start, final int before,
                                            final int count) {

            }

            @Override
            public final void afterTextChanged(final Editable s) {
                if (isValidatedOnValueChange()) {
                    validate();
                }

                adaptMaxNumberOfCharactersMessage();
            }

        };
    }
1310326
private synchronized void log(final String text)
	{

		try {
			this.writer.write(text);
		}
		catch (IOException ioe) {
			ioe.printStackTrace();
		}
	}
74040
public static void message(Object text, Object... data)
	{
		String txt = text != null ? text.toString() : "null";
		if (text instanceof Object[])
			txt = Arrays.deepToString((Object[]) text);

		//on server simply log messages
		if (!MalisisCore.isClient())
		{
			log.info(String.format(txt, data));
			return;
		}

		TextComponentString msg = new TextComponentString(I18n.format(txt, data));
		if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER)
		{
			MinecraftServer server = FMLCommonHandler.instance().getSidedDelegate().getServer();

			if (server != null)
				server.getPlayerList().sendMessage(msg);
		}
		else
		{
			EntityPlayer player = Utils.getClientPlayer();
			if (player == null)
				return;
			Style cs = new Style();
			cs.setItalic(true);
			cs.setColor(TextFormatting.GRAY);
			msg.setStyle(cs);

			player.sendMessage(msg);
		}
	}
408572
@Override @DefinedBy(Api.COMPILER_TREE)
    public Void visitText(TextTree tree, Void ignore) {
        if (hasNonWhitespace(tree)) {
            checkAllowsText(tree);
            markEnclosingTag(Flag.HAS_TEXT);
        }
        return null;
    }
1088516
@SuppressWarnings("deprecation")
    @Override
    public void eventCallback(String eventName, Object eventData) {
        try {
            PopupData popupData = null;
            
            if (eventData instanceof PopupData) {
                popupData = (PopupData) eventData;
            } else {
                popupData = new PopupData(eventData.toString());
            }
            
            if (popupData.isEmpty()) {
                return;
            }
            
            Page currentPage = ExecutionContext.getPage();
            Window window = getPopupWindow();
            window.setTitle(popupData.getTitle());
            window.setParent(currentPage);
            String pos = getPosition();
            window.addStyle("left", pos);
            window.addStyle("top", pos);
            window.addEventListener("close", this);
            Label label = window.findByName("messagetext", Label.class);
            label.setLabel(popupData.getMessage());
            window.setMode(Mode.POPUP);
        } catch (Exception e) {}
    }
869684
private void processWatchers(MethodSpec.Builder createdMethodBuilder) {
    createdMethodBuilder.addStatement("Proto p = __proto__");
    getMethodsWithAnnotation(component, Watch.class)
        .forEach(method -> processWatcher(createdMethodBuilder, method));
  }
15707
public void writeCharacters(String text) throws XMLStreamException {
		try {
			this.checkPendingATEvents();
			encoder.encodeCharacters(new StringValue(text));
		} catch (Exception e) {
			throw new XMLStreamException(e.getLocalizedMessage(), e);
		}
	}
335484
protected void process(BufferedReader bufferedReader) throws IOException {
        Matcher eventMatcher;
        Matcher exceptionMatcher;
        String line;
        while ((line = bufferedReader.readLine()) != null) {
            //skip empty line entries
            eventMatcher = regexpPattern.matcher(line);
            if (line.trim().equals("")) {continue;}
            exceptionMatcher = exceptionPattern.matcher(line);
            if (eventMatcher.matches()) {
                //build an event from the previous match (held in current map)
                LoggingEvent event = buildEvent();
                if (event != null) {
                    if (passesExpression(event)) {
                        doPost(event);
                    }
                }
                currentMap.putAll(processEvent(eventMatcher.toMatchResult()));
            } else if (exceptionMatcher.matches()) {
                //an exception line
                additionalLines.add(line);
            } else {
                //neither...either post an event with the line or append as additional lines
                //if this was a logging event with multiple lines, each line will show up as its own event instead of being
                //appended as multiple lines on the same event..
                //choice is to have each non-matching line show up as its own line, or append them all to a previous event
                if (appendNonMatches) {
                    //hold on to the previous time, so we can do our best to preserve time-based ordering if the event is a non-match
                    String lastTime = (String)currentMap.get(TIMESTAMP);
                    //build an event from the previous match (held in current map)
                    if (currentMap.size() > 0) {
                        LoggingEvent event = buildEvent();
                        if (event != null) {
                            if (passesExpression(event)) {
                              doPost(event);
                            }
                        }
                    }
                    if (lastTime != null) {
                        currentMap.put(TIMESTAMP, lastTime);
                    }
                    currentMap.put(MESSAGE, line);
                } else {
                    additionalLines.add(line);
                }
            }
        }

        //process last event if one exists
        LoggingEvent event = buildEvent();
        if (event != null) {
            if (passesExpression(event)) {
                doPost(event);
            }
        }
    }
349243
public void init(String text)
    {
        m_iCurrentState = OFF;
        if (m_iconOff == null)
        {
            m_iconOff = BaseApplet.getSharedInstance().loadImageIcon(CHECKBOX_OFF);
            m_iconOn = BaseApplet.getSharedInstance().loadImageIcon(CHECKBOX_ON);
            m_iconNull = BaseApplet.getSharedInstance().loadImageIcon(CHECKBOX_NULL);
        }
        this.setIcon(m_iconOff);
        this.setBorder(null);
        this.setMargin(JScreenConstants.NO_INSETS);
        this.setOpaque(false);
        
        this.addActionListener(this);
    }
103362
public void handleData(String data) {
		if (data == null) return;
		text = data;
		sendEvent(new TextInputEvent(this.user, getPayload(), data));
		if (handler != null)
			handler.onType(data);
	}
836266
public void startRollingText()
    {        
    	for (int i = 0; i < INITIAL_TEXT.length(); i++)
    	{
    		StringBuilder sb = new StringBuilder(INITIAL_TEXT);
    		sb.insert(i + 1, "</font>");
    		sb.insert(i, "<font color=\"red\">");
    		sb.insert(0, "<html>");
    		sb.append("</html>");
    		rollingText[i] = sb.toString();
    	}

    	rollingTextThread = new Thread()
        {
    		Thread doRun = new Thread()
    		{
    			public void run()
    			{
    				label.setText(rollingText[textIndex]);
    			}
    		};
        	public void run()
        	{
        		while (true)
        		{
        			for (textIndex = 0; textIndex < rollingText.length; textIndex++)
        			{
        				try {
        					synchronized (this)
        					{
        						this.wait(150);
        					}
						} catch (InterruptedException e) {
							return;
						}
        				SwingUtilities.invokeLater(doRun);
        			}
        		}
        	};
        };
        rollingTextThread.start();
    }
1162654
@Override
  public void watch(DatabaseWatch watch, 
                    Result<Cancel> result, 
                    Object... args)
  {
    TableKelp tableKelp = _table.getTableKelp();
    
    RowCursor minCursor = tableKelp.cursor();
    RowCursor maxCursor = tableKelp.cursor();
    
    minCursor.clear();
    maxCursor.setKeyMax();
    
    _whereKraken.fillMinCursor(minCursor, args);
    _whereKraken.fillMaxCursor(minCursor, args);
    
    //QueryKelp whereKelp = _whereExpr.bind(args);
    // XXX: binding should be with unique
    //EnvKelp whereKelp = new EnvKelp(_whereKelp, args);
    
    //tableKelp.findOne(minCursor, maxCursor, whereKelp,
    //                  new FindDeleteResult(result));
    
    _table.addWatch(watch, minCursor.getKey(), result);
    
    // result.completed(null);
  }
641854
@Override protected void handleEvents(final String EVENT_TYPE) {
        super.handleEvents(EVENT_TYPE);
        if ("VISIBILITY".equals(EVENT_TYPE)) {
            boolean isDateVisible = clock.isDateVisible();
            dateText.setVisible(isDateVisible);
            dateText.setManaged(isDateVisible);
            boolean isSecondsVisible = clock.isSecondsVisible();
            secondBackgroundCircle.setVisible(isSecondsVisible);
            secondBackgroundCircle.setManaged(isSecondsVisible);
            secondArc.setVisible(isSecondsVisible);
            secondArc.setManaged(isSecondsVisible);
        } else if ("FINISHED".equals(EVENT_TYPE)) {

        }
    }