Exemple #1
0
 /**
  * Gets a list of all available command and keyboard shortcuts
  *
  * @deprecated for internal usage only.
  * @return list of available commands
  */
 @Deprecated
 public ArrayList<Command> getCommandList() {
   JSObject names = (JSObject) mEditor.getModel().eval("this.commands.byName");
   ArrayList<Command> arr = new ArrayList<>();
   for (String str : Commons.getAllProperties(names)) {
     arr.add(new Command((JSObject) names.getMember(str)));
   }
   return arr;
 }
Exemple #2
0
 /**
  * Copies the selected text to clipboard.
  *
  * @return True if performed successfully.
  */
 public boolean doCopy() {
   String copy = mEditor.getCopyText();
   if (copy != null && !copy.isEmpty()) {
     ClipboardContent content = new ClipboardContent();
     content.putString(copy);
     Clipboard.getSystemClipboard().setContent(content);
     return true;
   }
   return false;
 }
Exemple #3
0
 /**
  * Gets the current content from the editor. If the editor is not ready an empty text is returned.
  *
  * @return Current content in the editor.
  */
 public String getText() {
   return mEditor.getValue();
 }
Exemple #4
0
 /**
  * Gets the wrapper class for edit session that is associated with the editor. It contains various
  * methods to interact with the document under edit.
  *
  * @return the edit session for the editor.
  */
 public EditSession getSession() {
   return mEditor.getSession();
 }