Skip to content

Commit

Permalink
Add handler+icon for indent guide feature
Browse files Browse the repository at this point in the history
  • Loading branch information
kiritsuku committed Mar 4, 2014
1 parent 511fa9d commit 82d4440
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import org.eclipse.jface.text.Document
import org.junit.ComparisonFailure
import org.junit.Test
import IndentGuideGeneratorTest.FullRange
import org.scalaide.ui.internal.editor.decorators.IndentGuideGenerator
import org.scalaide.ui.internal.editor.decorators.indentguide.IndentGuideGenerator

object IndentGuideGeneratorTest {

Expand Down
1 change: 1 addition & 0 deletions org.scala-ide.sdt.core/about.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ The Scala IDE for Eclipse provides an integrated environment for creating Scala
Visit http://scala-ide.org/\n\n\
Typesafe Team: Luc Bourlier, Mirco Dotta, Iulian Dragos, Martin Odersky, and Hubert Plocinicak.\n\
Many thanks to David Bernard, Donna Malayeri, Eric Molitor, Matt Russell, Miles Sabin, Simon Schäfer, Mirko Stocker, Joshua Suereth, Eugene Vigdorchik, and all other contributors.\n\
Further thanks to FatCow Web Hosting - http://www.fatcow.com/ - for their icon set Farm-fresh.\n\
Binary file added org.scala-ide.sdt.core/icons/indent_guide.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions org.scala-ide.sdt.core/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1195,6 +1195,12 @@
id="org.scalaide.core.handler.showInferredSemicolons"
name="Show inferred semicolons">
</command>
<command
categoryId="scala.tools.eclipse.category"
description="Show Indent Guide"
id="org.scalaide.core.handler.indentGuide"
name="Show Indent Guide">
</command>
</extension>

<extension point="org.eclipse.ui.contexts">
Expand Down Expand Up @@ -1306,6 +1312,10 @@
class="org.scalaide.ui.internal.editor.decorators.semicolon.ShowInferredSemicolonsHandler"
commandId="org.scalaide.core.handler.showInferredSemicolons">
</handler>
<handler
class="org.scalaide.ui.internal.editor.decorators.indentguide.IndentGuideHandler"
commandId="org.scalaide.core.handler.indentGuide">
</handler>
</extension>
<extension
point="org.eclipse.ui.menus">
Expand Down Expand Up @@ -1334,6 +1344,12 @@
label="Show inferred semicolons"
style="toggle">
</command>
<command
commandId="org.scalaide.core.handler.indentGuide"
icon="icons/indent_guide.png"
label="Show Indent Guide"
style="toggle">
</command>
</toolbar>
</menuContribution>
<menuContribution
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package org.scalaide.ui.internal.editor
import org.scalaide.ui.syntax.ScalaSyntaxClasses
import org.scalaide.util.internal.ui.DisplayThread
import org.scalaide.util.internal.eclipse.SWTUtils.fnToPropertyChangeListener
import org.scalaide.ui.internal.editor.decorators.IndentGuidePainter
import org.scalaide.ui.internal.editor.decorators.indentguide.IndentGuidePainter
import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor
import org.eclipse.jdt.internal.ui.javaeditor.JavaSourceViewer
import org.eclipse.jface.text.source.SourceViewerConfiguration
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package org.scalaide.ui.internal.editor.decorators.indentguide

import org.scalaide.ui.internal.actions.AbstractToggleHandler
import org.scalaide.ui.internal.preferences.EditorPreferencePage

class IndentGuideHandler extends AbstractToggleHandler(
"org.scalaide.core.handler.indentGuide",
EditorPreferencePage.INDENT_GUIDE_ENABLE)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.scalaide.ui.internal.editor.decorators
package org.scalaide.ui.internal.editor.decorators.indentguide

import org.eclipse.jface.preference.PreferenceConverter
import org.eclipse.jface.text.source.ISourceViewer
Expand All @@ -7,6 +7,7 @@ import org.eclipse.swt.events.PaintEvent
import org.eclipse.swt.graphics.Color
import org.eclipse.swt.graphics.GC
import org.eclipse.swt.widgets.Display
import org.scalaide.ui.internal.editor.decorators.EditorPainter
import org.scalaide.ui.internal.preferences.EditorPreferencePage

/**
Expand Down

0 comments on commit 82d4440

Please sign in to comment.