@@ -19,16 +19,17 @@ package org.jetbrains.kotlin.ui.launch
19
19
import org.eclipse.core.resources.IProject
20
20
import org.eclipse.mylyn.commons.ui.dialogs.AbstractNotificationPopup
21
21
import org.eclipse.swt.SWT
22
+ import org.eclipse.swt.custom.StyleRange
23
+ import org.eclipse.swt.custom.StyledText
24
+ import org.eclipse.swt.graphics.Image
22
25
import org.eclipse.swt.layout.GridLayout
23
26
import org.eclipse.swt.widgets.Composite
24
27
import org.eclipse.swt.widgets.Display
25
- import org.eclipse.swt.widgets.Label
26
- import org.jetbrains.kotlin.core.utils.ProjectUtils
27
- import org.jetbrains.kotlin.ui.gridData
28
- import org.eclipse.swt.custom.StyledText
28
+ import org.eclipse.ui.ISharedImages
29
+ import org.eclipse.ui.PlatformUI
29
30
import org.jetbrains.kotlin.core.KotlinClasspathContainer
31
+ import org.jetbrains.kotlin.core.utils.ProjectUtils
30
32
import org.jetbrains.kotlin.ui.gridData
31
- import org.eclipse.swt.custom.StyleRange
32
33
33
34
class KotlinRuntimeConfigurator (private val project : IProject ) : Runnable {
34
35
companion object {
@@ -59,25 +60,27 @@ private class RuntimeNotificationPopup(display: Display) : AbstractNotificationP
59
60
}
60
61
61
62
override fun createContentArea (parent : Composite ) {
62
- val parentLayout = GridLayout (1 , true )
63
-
64
- parent.setLayout(parentLayout)
65
- parent.setLayoutData(gridData())
63
+ parent.setLayout(GridLayout (1 , true ))
64
+ parent.setLayoutData(gridData().apply { widthHint = 300 })
66
65
67
66
StyledText (parent, SWT .LEFT ).apply {
68
- setText(" $RUNTIME_JAR , $REFLECT_JAR were added to the project classpath." )
67
+ setText(" $RUNTIME_JAR , $REFLECT_JAR were added\n to the project classpath." )
69
68
makeBold(RUNTIME_JAR , REFLECT_JAR )
70
69
}
71
70
}
72
71
73
72
override fun getPopupShellTitle (): String = " Configure Kotlin in Project"
74
73
74
+ override fun getPopupShellImage (maximumHeight : Int ): Image ? {
75
+ return PlatformUI .getWorkbench().getSharedImages().getImage(ISharedImages .IMG_OBJS_INFO_TSK );
76
+ }
77
+
75
78
private fun StyledText.makeBold (vararg strs : String ) {
76
79
val styleRanges = strs.mapNotNull { str ->
77
80
val start = text.indexOf(str)
78
81
if (start < 0 ) return @mapNotNull null
79
82
80
- StyleRange (start, str.length, foreground, background , SWT .BOLD )
83
+ StyleRange (start, str.length, null , null , SWT .BOLD )
81
84
}
82
85
83
86
setStyleRanges(styleRanges.toTypedArray())
0 commit comments