Creates a {@link ConsoleEditor} based on the specified flavor & {@link jline.Terminal}.

@param flavor
@param terminal
@return
@throws org.jledit.EditorInitializationException
764214
@Override
    public ConsoleEditor create(String flavor, Terminal terminal) throws EditorInitializationException {
        return create(flavor, terminal, System.in, System.out);
    }
276193
@SuppressWarnings({"rawtypes", "unchecked"})
  public void initializeEditors(final Object editor) {
    if (editor instanceof HasValueChangeHandlers && valueChangeHandler != null) {
      ((HasValueChangeHandlers) editor).addValueChangeHandler(valueChangeHandler);
      // if widget has a value change handler, validate on change
      if (validateOnVueChangeHandler != null) {
        ((HasValueChangeHandlers) editor).addValueChangeHandler(validateOnVueChangeHandler);
      }
    }
    // if widget has a key up handler, validate on key up
    if (editor instanceof HasKeyUpHandlers && validateOnKeyUpHandler != null) {
      ((HasKeyUpHandlers) editor).addKeyUpHandler(validateOnKeyUpHandler);
    }
    // try to submit form on return
    if (editor instanceof HasKeyPressHandlers && commitOnReturnHandler != null) {
      ((HasKeyPressHandlers) editor).addKeyPressHandler(commitOnReturnHandler);
    }
  }
323418
public static void insert (@Nonnull final CharSequence aSeq, final int nIndex, final int nCodepoint)
  {
    if (!(aSeq instanceof StringBuilder))
    {
      insert (new StringBuilder (aSeq), nIndex, nCodepoint);
    }
    else
    {
      int nI = nIndex;
      if (nI > 0 && nI < aSeq.length ())
      {
        final char ch = aSeq.charAt (nI);
        final boolean low = Character.isLowSurrogate (ch);
        if (low && Character.isHighSurrogate (aSeq.charAt (nI - 1)))
        {
          nI--;
        }
      }
      ((StringBuilder) aSeq).insert (nI, Character.toChars (nCodepoint));
    }
  }
220402
public static void print(final CharSequence line) {
        print(new Applyable<ConsoleReaderWrapper>() {
            public void apply(ConsoleReaderWrapper consoleReaderWrapper) {
                consoleReaderWrapper.print(line);
            }
        });
    }
886510
@PostConstruct
    public void init() throws Exception {
        // init the title hamburger icon
        final JFXTooltip burgerTooltip = new JFXTooltip("Open drawer");

        drawer.setOnDrawerOpening(e -> {
            final Transition animation = titleBurger.getAnimation();
            burgerTooltip.setText("Close drawer");
            animation.setRate(1);
            animation.play();
        });
        drawer.setOnDrawerClosing(e -> {
            final Transition animation = titleBurger.getAnimation();
            burgerTooltip.setText("Open drawer");
            animation.setRate(-1);
            animation.play();
        });
        titleBurgerContainer.setOnMouseClicked(e -> {
            if (drawer.isClosed() || drawer.isClosing()) {
                drawer.open();
            } else {
                drawer.close();
            }
        });

        FXMLLoader loader = new FXMLLoader(getClass().getResource("/fxml/ui/popup/MainPopup.fxml"));
        loader.setController(new InputController());
        toolbarPopup = new JFXPopup(loader.load());

        optionsBurger.setOnMouseClicked(e ->
            toolbarPopup.show(optionsBurger,
                PopupVPosition.TOP,
                PopupHPosition.RIGHT,
                -12,
                15));
        JFXTooltip.setVisibleDuration(Duration.millis(3000));
        JFXTooltip.install(titleBurgerContainer, burgerTooltip, Pos.BOTTOM_CENTER);

        // create the inner flow and content
        context = new ViewFlowContext();
        // set the default controller
        Flow innerFlow = new Flow(ButtonController.class);

        final FlowHandler flowHandler = innerFlow.createHandler(context);
        context.register("ContentFlowHandler", flowHandler);
        context.register("ContentFlow", innerFlow);
        final Duration containerAnimationDuration = Duration.millis(320);
        drawer.setContent(flowHandler.start(new ExtendedAnimatedFlowContainer(containerAnimationDuration, SWIPE_LEFT)));
        context.register("ContentPane", drawer.getContent().get(0));

        // side controller will add links to the content flow
        Flow sideMenuFlow = new Flow(SideMenuController.class);
        final FlowHandler sideMenuFlowHandler = sideMenuFlow.createHandler(context);
        drawer.setSidePane(sideMenuFlowHandler.start(new ExtendedAnimatedFlowContainer(containerAnimationDuration,
            SWIPE_LEFT)));
    }
414872
public ConsoleAppender<ILoggingEvent> newConsoleAppender(Context loggerContext, String name, String logPattern) {
    PatternLayoutEncoder consoleEncoder = new PatternLayoutEncoder();
    consoleEncoder.setContext(loggerContext);
    consoleEncoder.setPattern(logPattern);
    consoleEncoder.start();
    ConsoleAppender<ILoggingEvent> consoleAppender = new ConsoleAppender<>();
    consoleAppender.setContext(loggerContext);
    consoleAppender.setEncoder(consoleEncoder);
    consoleAppender.setName(name);
    consoleAppender.setTarget("System.out");
    consoleAppender.start();
    return consoleAppender;
  }
323222
public JComponent getEditorToolBar(){
		CommandGroup commandGroup = getCommandGroup(getToolBarCommandGroupName());
		if(commandGroup == null){
			return null;
		}
		return commandGroup.createToolBar();
	}
1247750
static Action create(Runnable command)
    {
        Objects.requireNonNull(command, "The command may not be null");
        return new AbstractAction()
        {
            /**
             * Serial UID
             */
            private static final long serialVersionUID = 8693271079128413874L;

            @Override
            public void actionPerformed(ActionEvent e)
            {
                command.run();
            }
        };
    }
561321
public List<EditorError> createErrorList(Editor<T> editor, T value, String messageKey) {
        List<EditorError> result = new ArrayList<EditorError>();
        result.add(new BasicEditorError(editor, value, getInvalidMessage(messageKey)));
        return result;
    }
158223
@NonNull
  public static CreateFunctionStart createFunction(
      @Nullable String keyspace, @NonNull String functionName) {
    return new DefaultCreateFunction(
        keyspace == null ? null : CqlIdentifier.fromCql(keyspace),
        CqlIdentifier.fromCql(functionName));
  }
599141
private ConsoleEditor instantiate(Class<? extends ConsoleEditor> editorClass, Terminal terminal, InputStream in , PrintStream out) throws IllegalAccessException, InvocationTargetException, InstantiationException, NoSuchMethodException {
        Constructor constructor = editorClass.getConstructor(Terminal.class, InputStream.class, PrintStream.class);
        return (ConsoleEditor) constructor.newInstance(terminal, in , out);
    }
1061623
def createEditor(self, parent, column, operator, value):
        
        editor = super(EnumPlugin, self).createEditor(parent,
                                                      column,
                                                      operator,
                                                      value)
        
        editor.setEnum(column.enum())
        if operator in ('contains', 'does not contain'):
            editor.setCheckable(True)
        
        editor.setCurrentValue(value)
        return editor
1099275
private void runInternal(IMarker marker) throws CoreException {
        Assert.isNotNull(marker);

       PendingRewrite pending = resolveWithoutWriting(marker);
       if(pending == null){
           return;
       }

        try {
            IRegion region = completeRewrite(pending);
            if(region == null){
                return;
            }
            IEditorPart part = EditorUtility.isOpenInEditor(pending.originalUnit);
            if (part instanceof ITextEditor) {
                ((ITextEditor) part).selectAndReveal(region.getOffset(), region.getLength());
            }
        } finally {
            pending.originalUnit.discardWorkingCopy();
        }
    }
1017360
public void init(IPageBookViewPage page, IConsole console)
	{
		fPage = page;
		fConsole = (VdmDebugConsole) console;

		// fRemoveTerminated = new ConsoleRemoveLaunchAction(fConsole.getProcess().getLaunch());
		// fRemoveAllTerminated = new ConsoleRemoveAllTerminatedAction();
		fTerminate = new ConsoleTerminateAction(page.getSite().getWorkbenchWindow(), fConsole);
		// fStdOut = new ShowStandardOutAction();
		// fStdErr = new ShowStandardErrorAction();

		fView = (IConsoleView) fPage.getSite().getPage().findView(IConsoleConstants.ID_CONSOLE_VIEW);

		DebugPlugin.getDefault().addDebugEventListener(this);
		DebugUITools.getDebugContextManager().getContextService(fPage.getSite().getWorkbenchWindow()).addDebugContextListener(this);

		// contribute to toolbar
		IActionBars actionBars = fPage.getSite().getActionBars();
		configureToolBar(actionBars.getToolBarManager());

		// create handler and submissions for EOF
		fEOFHandler = new EOFHandler();
	}
1046330
@Deprecated
  public static Parser<?> runnable(final Runnable runnable) {
    return new Parser<Object>() {      
      @Override boolean apply(ParseContext ctxt) {
        runnable.run();
        return true;
      }
      
      @Override public String toString() {
        return runnable.toString();
      }
    };
  }
931401
private void cmdAttachPrefixActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_buttonAdvancedPropertiesActionPerformed
		SelectPrefixPanel dialog = new SelectPrefixPanel(apic.getMutablePrefixManager(), queryTextPane);
		dialog.show();
	}
407429
protected JComponent createViewToolBar() {
    	if(getPageComponent() instanceof AbstractEditor){
    		AbstractEditor editor = (AbstractEditor)getPageComponent();
            return editor.getEditorToolBar();
    	}
    	return null;
    }