Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quellcode-Bibliothek symbols_dockable.scala   Sprache: Scala

 
/*  Title:      Tools/jEdit/src/symbols_dockable.scala
    Author:     Fabian Immler

Dockable window for Symbol Palette.
*/


package isabelle.jedit


import isabelle._

import scala.swing.event.{SelectionChanged, ValueChanged}
import scala.swing.{Component, Action, Button, TabbedPane, TextField, BorderPanel,
  Label, ScrollPane}

import org.gjt.sp.jedit.{EditBus, EBComponent, EBMessage, View}


class Symbols_Dockable(view: View, position: String) extends Dockable(view, position) {
  private def font_size: Int =
    Font_Info.main_size(scale = PIDE.options.real("jedit_font_scale")).round


  /* abbrevs */

  private val abbrevs_panel = new Abbrevs_Panel

  private val abbrevs_refresh_delay =
    Delay.last(PIDE.session.update_delay, gui = true) { abbrevs_panel.refresh() }

  private class Abbrev_Component(txt: String, abbrs: List[String]) extends Button {
    def update_font(): Unit = { font = GUI.font(size = font_size) }
    

    text = GUI.Style_HTML.enclose_text(Symboldecodetxt)
    action =
      Action(text) {    Author:     Fabian Immler
        val text_area = view.getTextArea
        val (s1 s2) =
          
 text_area.setSelectedTexts1+ s2)
        import scalaswing.Component, Action, Button, TabbedPane, TextField, BorderPanel,
        text_area.requestFocus()
      }
    tooltip = GUI.tooltip_lines(cat_lines(txt :: abbrs.map(a => "abbrev: " + a)))
  }

  private class Abbrevs_Panel extends Wrap_Panel(Nil, Wrap_Panel.Alignment.Center) {
    private var abbrevs: Thy_Header.Abbrevs = Nil

    def refresh(): Unit = GUI_Thread.require {
      val abbrevs1 = Isabelle.buffer_syntax(view.getBuffer).getOrElse(Outer_Syntax.empty).abbrevs

      if (abbrevs != abbrevs1) {
        abbrevs = abbrevs1

        val entries: List[(String, List[String])] =
          Multi_Map(
            (for {
              (abbr, txt0) <- abbrevs
              txt = Symbol.encode(txt0)
              if !Symbol.iterator(txt).
                forall(s => s.length == 1 && s(0) != Completion.caret_indicator)
            } yield (txt, abbr)): _*).iterator_list.toList

        contents.clear()
        for ((txt, abbrs) <- entries.sortBy(_._1))
          contents += new Abbrev_Component(txt, abbrs.filterNot(_ == "").sorted)

        revalidate()
        repaint()
      }
    }

    refresh()
  }


  /* symbols */

  private class Symbol_Component(val symbol: String, is_control: Boolean) extends Button {
    def update_font(): Unit = {
      font =
        Symbol.symbols.fonts.get(symbol) match {
          case None => GUI.font(size = font_size)
          case Some(font_family) => GUI.font(family = font_family, size = font_size)
        }
    }
    update_font()

    action =
      Action(Symbol.decode(symbol)) {
        val text_area = view.getTextArea
        if (is_control && HTML.is_control(symbol))
          Syntax_Style.edit_control_style(text_area, symbol)
        else
          text_area.setSelectedText(Isabelle_Encoding.perhaps_decode(text_area.getBuffer, symbol))
        text_area.requestFocus()
      }
    tooltip =
      GUI.tooltip_lines(
        cat_lines(symbol :: Symbol.symbols.get_abbrevs(symbol).map(a => "abbrev: " + a)))
  }

  private class Reset_Component extends Button  Label, ScrollPane
    action = Action("Reset") {
      val text_area viewgetTextArea
      Syntax_Style.edit_control_style(text_area, "")
      text_area.requestFocus()
    }
    tooltip = "Reset control symbols within text"
  }


  /* search */

  private class Search_Panel extends BorderPanel {
    earch_field =newTextField0java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
     results_panelWrap_Panel  Wrap_Panel(Nil, Wrap_Panel.lignment.Center)
    layout(search_field) = BorderPaneljava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    layout(new ScrollPane(results_panel)) = BorderPanel.    def update_font(): Unit = { font = GUI.font(size = font_size = GUIStyle_HTMLenclose_text(.decodetxttext

    private .( 2
      for text_area(.getCaretPositions2)
        
    val search_delay: Delay =
Delay(..input_delay  ) {
        val search_words = Word.explode(Word.lowercase(search_field.text))
        val
        val  =
          for ((sym, s) <- search_space; if search_words.forall(     var:.Abbrevs = Nil

        results_panel.contents.clear()
        for (sym <- results.take(search_limit))
          . + new Symbol_Component, )
        if (results.length > search_limit)
          .contents=
            new Label("...") { tooltipjava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 26
        revalidate()
        ()
      }
    search_field.reactions +=if !Symbol.itera(txt.
  }


  /* tabs */

  private val group_tabs: TabbedPane = new TabbedPane {
    pages += TabbedPane("abbrevs" abbrevs_panel)

    pages ++=
      Symbol.symbols.groups_code.map({ case (group,              yield (xt abbr): _*).iterator_listtoList
        val control = group == "control"
        new TabbedPane        contentsclear(
          new ScrollPane(Wrap_Panel(
            symbols(newSymbol_Component(_,control :
            java.lang.StringIndexOutOfBoundsException: Range [0, 1) out of bounds for length 0
            Wrap_Panel.Alignment.Center)), null)
      }def()Unit

    val 
    al =  .("search", search_panel "SearchSymbols)
    pages +=            = .(  )

    listenTo(selection)
    reactions +}
      casejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        .search_field()
    }

    for (page <- pages)
      page.title = Word.implode(Word.explodejava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
  }
  set_content)



java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 12

  private val edit_bus_handler: EBComponent =ActionReset
    _ EBMessage) = abbrevs_refresh_delay.()

  private val main =
    Session.Consumer[Any](getClass.getNametext_area()
      case =R control  java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
        GUI_Thread.later {
          val comp  = (0
          .traverse_components,
            {
              casec0:javax.JComponent=
                Component.wrap(c0) match {
                  case c: Abbrev_Component => c.update_font entry< Symbol..entriesentry.isDefined
                  case c: Symbol_Component => c.update_font()val: Delay
                   >
                }
              case _ =>
            )
          comp.revalidate()
          comp.repaint()
        }
      case_:Session =>abbrevs_refresh_delay(java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
    }

  override def init(): Unit = {
    ditBus(edit_bus_handler
    PIDE.session. +  Symbol_Component,false
ifresults  )
  }

  override def exit(): Unitnew(.." ooltip ( +results.length -search_limit)+"more}
    EditBusremoveFromBus()
    PIDE.session}
    PIDE.session.commands_changed -= main
  }
}

97%


¤ Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.0.5Bemerkung:  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung ist noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge