Ejemplo n.º 1
0
 private void handleSelect() {
   if (DBG) {
     Log.d(LOG_TAG, "--- handleSelect:" + mEditFlag + "," + mState);
   }
   if (!mEditFlag) {
     return;
   }
   if (mState == STATE_SELECT_OFF) {
     if (isTextSelected()) {
       Log.e(LOG_TAG, "Selection is off, but selected");
     }
     setSelectStartPos();
     blockSoftKey();
     mEST.setHintMessage(HINT_MSG_SELECT_END);
   } else if (mState == STATE_SELECT_ON) {
     if (isTextSelected()) {
       Log.e(LOG_TAG, "Selection now start, but selected");
     }
     setSelectedEndPos();
     mEST.setHintMessage(HINT_MSG_PUSH_COMPETE);
     doNextHandle();
   } else if (mState == STATE_SELECTED) {
     if (!isTextSelected()) {
       Log.e(LOG_TAG, "Selection is done, but not selected");
     }
     setSelectedEndPos();
     doNextHandle();
   }
 }
Ejemplo n.º 2
0
 private void handleResetEdit() {
   if (DBG) {
     Log.d(LOG_TAG, "Reset Editor");
   }
   blockSoftKey();
   handleCancel();
   mEditFlag = true;
   mEST.setHintMessage(HINT_MSG_SELECT_START);
 }
Ejemplo n.º 3
0
 private void handleSetSpan(int mode) {
   if (DBG) {
     Log.d(LOG_TAG, "--- handleSetSpan:" + mEditFlag + "," + mState + ',' + mMode);
   }
   if (!mEditFlag) {
     Log.e(LOG_TAG, "--- handleSetSpan: Editing is not started.");
     return;
   }
   if (mMode == MODE_NOTHING || mMode == MODE_SELECT) {
     mMode = mode;
     if (mState == STATE_SELECTED) {
       mState = STATE_SELECT_FIX;
       handleSetSpan(mode);
     } else {
       handleSelect();
     }
   } else if (mMode != mode) {
     handleCancel();
     mMode = mode;
     handleSetSpan(mode);
   } else {
     if (mState == STATE_SELECT_FIX) {
       mEST.setHintMessage(HINT_MSG_NULL);
       switch (mode) {
         case MODE_COLOR:
           mEST.onShowForegroundColorAlert();
           break;
         case MODE_SIZE:
           mEST.onShowSizeAlert();
           break;
         case MODE_ALIGN:
           mEST.onShowAlignAlert();
           break;
         default:
           Log.e(LOG_TAG, "--- handleSetSpan: invalid mode.");
           break;
       }
     } else {
       Log.d(LOG_TAG, "--- handleSetSpan: do nothing.");
     }
   }
 }