Package editor
Class GosuPanel
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- editor.GosuPanel
-
- All Implemented Interfaces:
java.awt.image.ImageObserver,java.awt.MenuContainer,java.io.Serializable,javax.accessibility.Accessible
public class GosuPanel extends javax.swing.JPanel- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classGosuPanel.RedoActionHandler(package private) classGosuPanel.SysInListener(package private) classGosuPanel.UndoActionHandler-
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
-
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
-
-
Field Summary
Fields Modifier and Type Field Description private TabPane_bottomTabPaneprivate BreakpointManager_breakpointManagerprivate SystemPanel_consolePanelprivate Debugger_debuggerprivate DebugPanel_debugPanelprivate AtomicUndoManager_defaultUndoMgrprivate TabPane_editorTabPaneprivate Experiment_experimentprivate ExperimentView_experimentViewprivate NavigationHistory_historyprivate boolean_initialFileprivate java.io.OutputStreamWriter_inWriterprivate MessagesPanel_messagesprivate java.io.InputStream_oldInprivate CollapsibleSplitPane_outerSplitPaneprivate javax.swing.JFrame_parentFrameprivate IProcessRunner_processRunnerprivate RunState_runStateprivate SearchPanel_searchesprivate CollapsibleSplitPane_splitPaneprivate LabStatusBar_statusBarprivate GosuPanel.SysInListener_sysInListenerprivate TypeNameCache_typeNamesCacheprivate static intMAX_TABS-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
-
Constructor Summary
Constructors Constructor Description GosuPanel(javax.swing.JFrame frame)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBusySignal(RunState runState)private voidaddDirtyListener(EditorHost editor)private voidaddIssueKeyMarkers(java.lang.String[] strLines, java.util.List<java.lang.Integer> lines, java.util.Map<java.lang.Integer,java.util.List<java.lang.String>> map)booleancanGoBackward()booleancanGoForward()voidclearDebugger()voidclearOutput()voidclearTabs()private voidcloseActiveEditor()private voidcloseOthers()voidcloseTab(java.nio.file.Path file)booleancompile(java.util.Set<IType> types)(package private) voidconfigUI()private EditorHostcreateEditor(java.nio.file.Path file, IScriptPartId partId)voiddebug(IRunConfig runConfig)private voiddisplayClasspath()voiddisplayRecentViewsPopup()voiddumpBytecode()voidexecute(IRunConfig runConfig)voidexit()EditorHostfindTab(java.nio.file.Path file)BreakpointManagergetBreakpointManager()private IGosuClassgetClassAtCaret()java.awt.datatransfer.ClipboardgetClipboard()SystemPanelgetConsolePanel()EditorHostgetCurrentEditor()java.nio.file.PathgetCurrentFile()GosuEditorgetCurrentGosuEditor()DebuggergetDebugger()DebugPanelgetDebugPanel()TabPanegetEditorTabPane()ExperimentgetExperiment()ExperimentViewgetExperimentView()EditorHostgetGosuEditor()private GosuPanelgetGosuPanel()MessagesPanelgetMessagesPanel()java.util.List<FileTree>getOpenFilesInProject()IRunConfiggetRunConfig()SearchPanelgetSearchPanel()NavigationHistorygetTabSelectionHistory()TypeNameCachegetTypeNamesCache()AtomicUndoManagergetUndoManager()voidgoBackward()voidgoForward()private voidhandleDebuggerStateChange()private voidhandleMacStuff()booleanisDebugging()booleanisDirty(EditorHost editor)booleanisRunning()private booleanisValidGosuSourceFile(java.nio.file.Path file)private java.lang.StringjoinLines(java.lang.String[] strLines)voidjumptToBreakpoint(com.sun.jdi.Location location, boolean bFocus)voidkillProcess()booleanmake()private voidmakeBuildMenu(javax.swing.JMenuBar menuBar)private voidmakeCodeMenu(javax.swing.JMenuBar menuBar)voidmakeDebugger(com.sun.jdi.VirtualMachine vm)private voidmakeEditMenu(javax.swing.JMenuBar menuBar)private voidmakeFileMenu(javax.swing.JMenuBar menuBar)private voidmakeHelpMenu(javax.swing.JMenuBar menuBar)private java.lang.StringmakeIssueString(java.util.List<java.lang.String> issues)private ToolBarmakeMainToolbar()private javax.swing.JMenuBarmakeMenuBar()static IScriptPartIdmakePartId(java.nio.file.Path file)private voidmakeRunMenu(javax.swing.JMenuBar menuBar)private voidmakeSearchMenu(javax.swing.JMenuBar menuBar)private javax.swing.JComponentmakeSeparator()private javax.swing.JPanelmakeStatusBar()private voidmakeWindowMenu(javax.swing.JMenuBar menuBar)private voidmapKeystroke(javax.swing.KeyStroke ks, java.lang.String strCmd, javax.swing.Action action)private voidmapKeystrokes()private voidmarkErrorsForGosuLanguageTest()voidnewExperiment()voidopenExperiment()voidopenExperiment(java.nio.file.Path experimentDir)voidopenFile()private voidopenFile(IScriptPartId partId, java.nio.file.Path file, boolean bFocus)voidopenFile(java.nio.file.Path file, boolean bFocus)voidopenInitialFile(IScriptPartId partId, java.nio.file.Path file)private booleanopenTab(java.nio.file.Path file, boolean bFocus)booleanopenType(java.lang.String fqn, boolean bFocus)private voidparse()voidpipeInput()booleanrebuild()voidrefresh(java.nio.file.Path file)This should only be called when either the file's contents change externally, or when the file saves to disk.(package private) voidreload(IType type)voidremoveBusySignal()private voidremoveLruTab()private voidremoveOldIssueKeyMarkers(java.lang.String[] lines)(package private) voidresetChangeHandler()voidrestoreExperimentState(Experiment experiment)booleansave()booleansave(java.nio.file.Path file, EditorHost editor)private voidsaveAndReloadType(java.nio.file.Path file, EditorHost editor)voidsaveAs()booleansaveIfDirty()private voidsavePreviousTab()voidselectTab(java.nio.file.Path file)private voidsetCurrentFile(java.nio.file.Path file)voidsetDirty(EditorHost editor, boolean bDirty)voidsetEditorSplitPosition(int iPos)voidsetExperimentSplitPosition(int iPos)voidsetStatus(java.lang.String status)voidshipIt()SystemPanelshowConsole(boolean bShow)voidshowDebugger(boolean bShow)MessagesPanelshowMessages(boolean bShow)SearchPanelshowSearches(boolean bShow)<P extends javax.swing.JComponent>
PshowTab(boolean bShow, java.lang.String title, javax.swing.Icon icon, P panel, java.util.function.Supplier<P> creator)private voidstoreExperimentState()private voidupdateTitle()-
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
MAX_TABS
private static final int MAX_TABS
- See Also:
- Constant Field Values
-
_consolePanel
private SystemPanel _consolePanel
-
_outerSplitPane
private CollapsibleSplitPane _outerSplitPane
-
_splitPane
private CollapsibleSplitPane _splitPane
-
_experimentView
private ExperimentView _experimentView
-
_parentFrame
private javax.swing.JFrame _parentFrame
-
_runState
private RunState _runState
-
_editorTabPane
private TabPane _editorTabPane
-
_bottomTabPane
private TabPane _bottomTabPane
-
_defaultUndoMgr
private AtomicUndoManager _defaultUndoMgr
-
_history
private NavigationHistory _history
-
_statusBar
private LabStatusBar _statusBar
-
_initialFile
private boolean _initialFile
-
_typeNamesCache
private TypeNameCache _typeNamesCache
-
_experiment
private Experiment _experiment
-
_inWriter
private java.io.OutputStreamWriter _inWriter
-
_sysInListener
private GosuPanel.SysInListener _sysInListener
-
_oldIn
private java.io.InputStream _oldIn
-
_messages
private MessagesPanel _messages
-
_searches
private SearchPanel _searches
-
_debugPanel
private DebugPanel _debugPanel
-
_processRunner
private IProcessRunner _processRunner
-
_breakpointManager
private BreakpointManager _breakpointManager
-
_debugger
private Debugger _debugger
-
-
Method Detail
-
getTabSelectionHistory
public NavigationHistory getTabSelectionHistory()
-
configUI
void configUI()
-
makeMainToolbar
private ToolBar makeMainToolbar()
-
makeSeparator
private javax.swing.JComponent makeSeparator()
-
getExperimentView
public ExperimentView getExperimentView()
-
getMessagesPanel
public MessagesPanel getMessagesPanel()
-
getSearchPanel
public SearchPanel getSearchPanel()
-
getConsolePanel
public SystemPanel getConsolePanel()
-
getDebugPanel
public DebugPanel getDebugPanel()
-
showMessages
public MessagesPanel showMessages(boolean bShow)
-
showSearches
public SearchPanel showSearches(boolean bShow)
-
showConsole
public SystemPanel showConsole(boolean bShow)
-
showTab
public <P extends javax.swing.JComponent> P showTab(boolean bShow, java.lang.String title, javax.swing.Icon icon, P panel, java.util.function.Supplier<P> creator)
-
handleMacStuff
private void handleMacStuff()
-
clearTabs
public void clearTabs()
-
storeExperimentState
private void storeExperimentState()
-
getExperiment
public Experiment getExperiment()
-
restoreExperimentState
public void restoreExperimentState(Experiment experiment)
-
makeStatusBar
private javax.swing.JPanel makeStatusBar()
-
setStatus
public void setStatus(java.lang.String status)
-
parse
private void parse()
-
savePreviousTab
private void savePreviousTab()
-
createEditor
private EditorHost createEditor(java.nio.file.Path file, IScriptPartId partId)
-
addDirtyListener
private void addDirtyListener(EditorHost editor)
-
makeMenuBar
private javax.swing.JMenuBar makeMenuBar()
-
makeHelpMenu
private void makeHelpMenu(javax.swing.JMenuBar menuBar)
-
makeWindowMenu
private void makeWindowMenu(javax.swing.JMenuBar menuBar)
-
makeCodeMenu
private void makeCodeMenu(javax.swing.JMenuBar menuBar)
-
getCurrentGosuEditor
public GosuEditor getCurrentGosuEditor()
-
makeBuildMenu
private void makeBuildMenu(javax.swing.JMenuBar menuBar)
-
getCurrentEditor
public EditorHost getCurrentEditor()
-
getRunConfig
public IRunConfig getRunConfig()
-
makeRunMenu
private void makeRunMenu(javax.swing.JMenuBar menuBar)
-
makeSearchMenu
private void makeSearchMenu(javax.swing.JMenuBar menuBar)
-
getGosuPanel
private GosuPanel getGosuPanel()
-
makeEditMenu
private void makeEditMenu(javax.swing.JMenuBar menuBar)
-
makeFileMenu
private void makeFileMenu(javax.swing.JMenuBar menuBar)
-
closeActiveEditor
private void closeActiveEditor()
-
closeOthers
private void closeOthers()
-
displayClasspath
private void displayClasspath()
-
shipIt
public void shipIt()
-
make
public boolean make()
-
compile
public boolean compile(java.util.Set<IType> types)
-
rebuild
public boolean rebuild()
-
exit
public void exit()
-
setEditorSplitPosition
public void setEditorSplitPosition(int iPos)
-
setExperimentSplitPosition
public void setExperimentSplitPosition(int iPos)
-
getGosuEditor
public EditorHost getGosuEditor()
-
mapKeystrokes
private void mapKeystrokes()
-
mapKeystroke
private void mapKeystroke(javax.swing.KeyStroke ks, java.lang.String strCmd, javax.swing.Action action)
-
resetChangeHandler
void resetChangeHandler()
-
openFile
public void openFile()
-
openFile
public void openFile(java.nio.file.Path file, boolean bFocus)
-
openType
public boolean openType(java.lang.String fqn, boolean bFocus)
-
makePartId
public static IScriptPartId makePartId(java.nio.file.Path file)
-
openInitialFile
public void openInitialFile(IScriptPartId partId, java.nio.file.Path file)
-
openFile
private void openFile(IScriptPartId partId, java.nio.file.Path file, boolean bFocus)
-
removeLruTab
private void removeLruTab()
-
updateTitle
private void updateTitle()
-
openTab
private boolean openTab(java.nio.file.Path file, boolean bFocus)
-
findTab
public EditorHost findTab(java.nio.file.Path file)
-
setCurrentFile
private void setCurrentFile(java.nio.file.Path file)
-
getCurrentFile
public java.nio.file.Path getCurrentFile()
-
save
public boolean save()
-
save
public boolean save(java.nio.file.Path file, EditorHost editor)
-
saveAndReloadType
private void saveAndReloadType(java.nio.file.Path file, EditorHost editor)
-
reload
void reload(IType type)
-
saveIfDirty
public boolean saveIfDirty()
-
refresh
public void refresh(java.nio.file.Path file)
This should only be called when either the file's contents change externally, or when the file saves to disk.
-
newExperiment
public void newExperiment()
-
openExperiment
public void openExperiment()
-
openExperiment
public void openExperiment(java.nio.file.Path experimentDir)
-
isValidGosuSourceFile
private boolean isValidGosuSourceFile(java.nio.file.Path file)
-
saveAs
public void saveAs()
-
dumpBytecode
public void dumpBytecode()
-
getClassAtCaret
private IGosuClass getClassAtCaret()
-
execute
public void execute(IRunConfig runConfig)
-
debug
public void debug(IRunConfig runConfig)
-
isRunning
public boolean isRunning()
-
isDebugging
public boolean isDebugging()
-
getTypeNamesCache
public TypeNameCache getTypeNamesCache()
-
addBusySignal
public void addBusySignal(RunState runState)
-
pipeInput
public void pipeInput()
-
killProcess
public void killProcess()
-
getDebugger
public Debugger getDebugger()
-
clearDebugger
public void clearDebugger()
-
makeDebugger
public void makeDebugger(com.sun.jdi.VirtualMachine vm)
-
handleDebuggerStateChange
private void handleDebuggerStateChange()
-
jumptToBreakpoint
public void jumptToBreakpoint(com.sun.jdi.Location location, boolean bFocus)
-
showDebugger
public void showDebugger(boolean bShow)
-
getBreakpointManager
public BreakpointManager getBreakpointManager()
-
getEditorTabPane
public TabPane getEditorTabPane()
-
getOpenFilesInProject
public java.util.List<FileTree> getOpenFilesInProject()
-
removeBusySignal
public void removeBusySignal()
-
clearOutput
public void clearOutput()
-
getUndoManager
public AtomicUndoManager getUndoManager()
-
selectTab
public void selectTab(java.nio.file.Path file)
-
closeTab
public void closeTab(java.nio.file.Path file)
-
goBackward
public void goBackward()
-
canGoBackward
public boolean canGoBackward()
-
goForward
public void goForward()
-
canGoForward
public boolean canGoForward()
-
displayRecentViewsPopup
public void displayRecentViewsPopup()
-
isDirty
public boolean isDirty(EditorHost editor)
-
setDirty
public void setDirty(EditorHost editor, boolean bDirty)
-
getClipboard
public java.awt.datatransfer.Clipboard getClipboard()
-
markErrorsForGosuLanguageTest
private void markErrorsForGosuLanguageTest()
-
joinLines
private java.lang.String joinLines(java.lang.String[] strLines)
-
removeOldIssueKeyMarkers
private void removeOldIssueKeyMarkers(java.lang.String[] lines)
-
addIssueKeyMarkers
private void addIssueKeyMarkers(java.lang.String[] strLines, java.util.List<java.lang.Integer> lines, java.util.Map<java.lang.Integer,java.util.List<java.lang.String>> map)
-
makeIssueString
private java.lang.String makeIssueString(java.util.List<java.lang.String> issues)
-
-