本文整理汇总了Java中processing.app.Editor类的典型用法代码示例。如果您正苦于以下问题:Java Editor类的具体用法?Java Editor怎么用?Java Editor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Editor类属于processing.app包,在下文中一共展示了Editor类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: end
import processing.app.Editor; //导入依赖的package包/类
@Override
public void end() {
try {
// Restore the original export handler
Util.setPrivateField(Editor.class, editor, EXPORT_HANDLER_FIELD_NAME, originalExportHandler);
Util.EditorStatus editorStatus = Util.readStatus(editor);
if (editorStatus.status == editorStatus.ERR) {
error = new HttpCommandException(editorStatus.message);
} else {
// Nothing to do here; the upload was a success; we notify this, by NOT setting any error field.
}
} catch (IllegalArgumentException | IllegalAccessException | NoSuchFieldException e1) {
error = new ReflectionException("Reflection error.", e1);
} catch (Throwable th) {
error = th;
}
finished = true;
}
开发者ID:flower-platform,项目名称:flower-platform-arduino-ide-plugin,代码行数:21,代码来源:UploadToBoardCommand.java
示例2: init
import processing.app.Editor; //导入依赖的package包/类
public void init(Editor editor) {
if (ArduBlockTool.editor == null )
{
ArduBlockTool.editor = editor;
ArduBlockTool.openblocksFrame = new ArduBlockToolFrame();
ArduBlockTool.openblocksFrame.addListener(this);
Context context = Context.getContext();
String arduinoVersion = this.getArduinoVersion();
context.setInArduino(true);
context.setArduinoVersionString(arduinoVersion);
context.setEditor(editor);
System.out.println("Arduino Version: " + arduinoVersion);
// Don't just "close" Ardublock, see if there's something to save first.
// Note to self: Code here only affects behaviour when we're an Arduino Tool,
// not when run directly - See Main.java for that.
//ArduBlockTool.openblocksFrame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
ArduBlockTool.openblocksFrame.addWindowListener( new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
ArduBlockTool.openblocksFrame.doCloseArduBlockFile();
}
});
}
}
示例3: init
import processing.app.Editor; //导入依赖的package包/类
public void init(Editor editor) {
if (ArduBlockTool.editor == null )
{
ArduBlockTool.editor = editor;
ArduBlockTool.openblocksFrame = new ArduBlockToolFrame();
ArduBlockTool.openblocksFrame.addListener(this);
Context context = Context.getContext();
String arduinoVersion = this.getArduinoVersion();
context.setInArduino(true);
context.setArduinoVersionString(arduinoVersion);
context.setEditor(editor);
System.out.println("Arduino Version: " + arduinoVersion);
}
}
示例4: readStatus
import processing.app.Editor; //导入依赖的package包/类
/**
* Reads the status field from the given editor instance.
* @param editor
* @return
*/
public static EditorStatus readStatus(Editor editor) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException {
processing.app.EditorStatus editorStatus = Util.getPrivateField(Editor.class, editor, "status");
EditorStatus result = new EditorStatus();
result.ERR = Util.<Integer>getPrivateField(processing.app.EditorStatus.class, processing.app.EditorStatus.class, "ERR");
result.status = Util.getPrivateField(processing.app.EditorStatus.class, editorStatus, "mode");
result.message = Util.getPrivateField(processing.app.EditorStatus.class, editorStatus, "message");
return result;
}
示例5: convertEditorStatusIntoCompilationResult
import processing.app.Editor; //导入依赖的package包/类
/**
* Utility function; analyzes the internal field "status" of the Arduino IDE main Editor, and
* calls the appropiate {@link CompilationListener#compilationSuccessful()} or
* {@link CompilationListener#compilationFailed(HttpCommandException)()} method.
*/
private void convertEditorStatusIntoCompilationResult(Editor editor, CompilationListener compilationListener) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException {
Util.EditorStatus editorStatus = Util.readStatus(editor);
if (editorStatus.status == editorStatus.ERR) {
compilationListener.compilationFailed(new HttpCommandException(editorStatus.message));
} else {
compilationListener.compilationSuccessful();
}
}
开发者ID:flower-platform,项目名称:flower-platform-arduino-ide-plugin,代码行数:15,代码来源:UpdateSourceFilesAndCompileCommand.java
示例6: UploadHandler
import processing.app.Editor; //导入依赖的package包/类
public UploadHandler(Editor editor, Runnable originalExportHandler) {
if (editor == null) {
throw new NullPointerException("The editor instance cannot be null.");
}
this.editor = editor;
this.originalExportHandler = originalExportHandler;
}
示例7: run
import processing.app.Editor; //导入依赖的package包/类
public Object run() {
Editor editor = FlowerPlatformPlugin.getInstance().getEditor();
JMenuBar menuBar = editor.getJMenuBar();
JMenu toolsMenu = menuBar.getMenu(3);
toolsMenu.getListeners(MenuListener.class)[0].menuSelected(null);
toolsMenu.getListeners(MenuListener.class)[1].menuSelected(null);
// set menu options
for (Component c : toolsMenu.getMenuComponents()) {
if ((c instanceof JMenu) && c.isVisible()) {
JMenu menu = (JMenu) c;
String option = menu.getText();
if (option == null) {
continue;
}
int index = option.indexOf(':');
if (index > 0) {
option = option.substring(0, index);
}
String newValue = options.get(option);
for (int i = 0; i < menu.getItemCount(); i++) {
JMenuItem item = menu.getItem(i);
if (item != null && item.isVisible() && item.getText().equals(newValue)) {
item.setSelected(true);
}
}
}
}
return null;
}
示例8: run
import processing.app.Editor; //导入依赖的package包/类
public Object run() {
Editor editor = FlowerPlatformPlugin.getInstance().getEditor();
JMenuBar menuBar = editor.getJMenuBar();
JMenu toolsMenu = menuBar.getMenu(3);
toolsMenu.getListeners(MenuListener.class)[0].menuSelected(null);
JMenu boardsMenu = null;
for (Component c : toolsMenu.getMenuComponents()) {
if (!(c instanceof JMenu) || !c.isVisible()) {
continue;
}
JMenu menu = (JMenu) c;
if (menu.getText().startsWith("Board")) {
boardsMenu = menu;
break;
}
}
List<String> boards = new ArrayList<>();
// start from 1 (skip first entry - "Boards manager")
for (int i = 1; i < boardsMenu.getItemCount(); i++) {
JMenuItem item = boardsMenu.getItem(i);
if (item != null && item.isEnabled()) {
// System.out.println(item.getText());
boards.add(item.getText());
}
}
return boards;
}
示例9: init
import processing.app.Editor; //导入依赖的package包/类
public void init(Editor editor) {
this.editor = editor;
}
示例10: setEditor
import processing.app.Editor; //导入依赖的package包/类
public void setEditor(Editor e) {
editor = e;
}
示例11: getEditor
import processing.app.Editor; //导入依赖的package包/类
public Editor getEditor() {
return editor;
}