Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
f0b769f
"New Library" button
Emgariko Jan 31, 2024
3958765
"New Library" button actionPerformed implementation
Emgariko Feb 1, 2024
f29e8df
Import created library model to all models in project when creating a…
Emgariko Feb 14, 2024
8fa3c60
Add model import via model access
Emgariko Feb 15, 2024
1dad057
Trying to properly import model
Emgariko Feb 15, 2024
a56df69
Another try to properly import the library model
Emgariko Feb 16, 2024
58fa46b
Importing library model and module properly but with a crutch
Emgariko Feb 16, 2024
fc044af
removing crutch
Emgariko Feb 19, 2024
162a37e
smth
Emgariko Feb 19, 2024
c7510cd
tried to create custom facet
Emgariko Feb 23, 2024
399b3c7
added lib icon
Emgariko Feb 23, 2024
98fd321
Tried to add Runtime.Basev3.0.0.2 lib
Emgariko Feb 27, 2024
4e64d0d
Tried to add Runtime.Basev3.0.0.2 lib
Emgariko Feb 27, 2024
22b344f
Removed docs
Emgariko Feb 27, 2024
187cd70
typo
Emgariko Feb 27, 2024
f6ba3be
Moved to anothed plugin
Emgariko Mar 1, 2024
5952246
Raw: import/export library actions
Emgariko Mar 6, 2024
c90b272
Export action fix + import fix
Emgariko Mar 6, 2024
5e47fb8
Import action fix
Emgariko Mar 7, 2024
0671ccc
Raw import action implementation
Emgariko Mar 7, 2024
df68a44
Import/export action: dialog with FileChooser and some refactoring
Emgariko Mar 8, 2024
a1be970
Import action small fix
Emgariko Mar 10, 2024
b62eb79
Import action small fix
Emgariko Mar 10, 2024
e3fa82f
Import action small fix
Emgariko Mar 10, 2024
c1288a8
Fixed module id mismatch
Emgariko Mar 27, 2024
916c53f
Trying to crerate custom facet
Emgariko Mar 28, 2024
0902d65
Successfully registered custom facet factory
Emgariko Mar 29, 2024
6a8dc4f
Small fix
Emgariko Mar 29, 2024
5395625
.
Emgariko Mar 30, 2024
8b0b4d3
.
Emgariko Mar 30, 2024
4863da3
.
Emgariko Mar 30, 2024
1a628ce
Trying to create FacetTab
Emgariko Apr 2, 2024
6bbbfc0
Simple FacetTab
Emgariko Apr 2, 2024
7c1a41c
Renamed Facet classes
Emgariko Apr 3, 2024
7426618
Refactored LibraryFacetTab class name
Emgariko Apr 8, 2024
93d66cd
Import Nxt Library action
Emgariko Apr 17, 2024
1465119
Import Nxt Library action
Emgariko Apr 18, 2024
368c3db
Import Nxt Library action
Emgariko Apr 18, 2024
b31dfb3
Import Nxt Library action
Emgariko Apr 19, 2024
178ece1
Implemented "Import NxtLib" functionality with namespaces
Emgariko Apr 19, 2024
73c046c
Implemented "Create namespace" & namespaces workaround
Emgariko Apr 21, 2024
0122e3d
Small fix
Emgariko Apr 22, 2024
7eff963
Facet-namespace logic
Emgariko Apr 23, 2024
fff5172
refactoring
Emgariko Apr 23, 2024
595d8e5
Library internal logic && tests
Emgariko Apr 23, 2024
2115199
Moved to separate plugin
Emgariko May 13, 2024
2136730
Moved to separate plugin
Emgariko May 13, 2024
3f32c9b
Moved to separate plugin
Emgariko May 13, 2024
56c911f
Refactored separate plugin, fixed build
Emgariko May 23, 2024
67b8b35
Facet logic & tests
Emgariko May 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .mps/modules.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<modulePath path="$PROJECT_DIR$/samples/smv-debugger/solutions/org.fbme.smvDebugger.sandbox/org.fbme.smvDebugger.sandbox.msd" folder="samples.smv debugger" />
<modulePath path="$PROJECT_DIR$/samples/statistics-plugin/buildsolution/org.fbme.samples.statisticsPlugin.build.msd" folder="samples.statistics plugin" />
<modulePath path="$PROJECT_DIR$/samples/statistics-plugin/solutions/org.fbme.samples.statisticsPlugin/org.fbme.samples.statisticsPlugin.msd" folder="samples.statistics plugin" />
<modulePath path="$PROJECT_DIR$/solutions/Runtime.Base/Runtime.Base.msd" folder="" />
</projectModules>
</component>
</project>

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2195,5 +2195,115 @@
</node>
</node>
</node>
<node concept="312cEu" id="7_LxsObuvqi">
<property role="TrG5h" value="LibraryByModule" />
<property role="1sVAO0" value="true" />
<node concept="15s5l7" id="7_LxsObuvqj" role="lGtFl">
<property role="1eyWvh" value="FLAVOUR_ISSUE_KIND=&quot;typesystem (typesystem)&quot;;FLAVOUR_MESSAGE=&quot;Error: The type @PlatformDeclarationBase.T extends node&lt;INamedConcept&gt; is not a valid substitute for the bounded parameter T&quot;;FLAVOUR_RULE_ID=&quot;[r:00000000-0000-4000-0000-011c895902c5(jetbrains.mps.baseLanguage.typesystem)/6871159928248660343]&quot;;" />
<property role="huDt6" value="Error: The type @PlatformDeclarationBase.T extends node&lt;INamedConcept&gt; is not a valid substitute for the bounded parameter T" />
</node>
<node concept="3Tm1VV" id="7_LxsObuvqk" role="1B3o_S" />
<node concept="16euLQ" id="7_LxsObuvql" role="16eVyc">
<property role="TrG5h" value="T" />
<node concept="3Tqbb2" id="7_LxsObuvqm" role="3ztrMU">
<ref role="ehGHo" to="tpck:h0TrEE$" resolve="INamedConcept" />
</node>
</node>
<node concept="3uibUv" id="7_LxsObuvqn" role="EKbjA">
<ref role="3uigEE" to="7adg:~ContainedElement" resolve="ContainedElement" />
</node>
<node concept="2tJIrI" id="7_LxsObuvqo" role="jymVt" />
<node concept="3clFbW" id="7_LxsObuvqp" role="jymVt">
<node concept="3cqZAl" id="7_LxsObuvqq" role="3clF45" />
<node concept="3Tm1VV" id="7_LxsObuvqr" role="1B3o_S" />
<node concept="3clFbS" id="7_LxsObuvqs" role="3clF47">
<node concept="XkiVB" id="7_LxsObuvqt" role="3cqZAp">
<ref role="37wK5l" node="1IuIrLUpCCt" resolve="PlatformDeclarationBase" />
<node concept="37vLTw" id="7_LxsObuvqu" role="37wK5m">
<ref role="3cqZAo" node="7_LxsObuvqw" resolve="node" />
</node>
<node concept="37vLTw" id="7_LxsObuvqv" role="37wK5m">
<ref role="3cqZAo" node="7_LxsObuvqy" resolve="owner" />
</node>
</node>
</node>
<node concept="37vLTG" id="7_LxsObuvqw" role="3clF46">
<property role="TrG5h" value="node" />
<node concept="16syzq" id="7_LxsObuvqx" role="1tU5fm">
<ref role="16sUi3" node="7_LxsObuvql" resolve="T" />
</node>
</node>
<node concept="37vLTG" id="7_LxsObuvqy" role="3clF46">
<property role="TrG5h" value="owner" />
<node concept="3uibUv" id="7_LxsObuvqz" role="1tU5fm">
<ref role="3uigEE" to="uvki:~PlatformElementsOwner" resolve="PlatformElementsOwner" />
</node>
</node>
</node>
<node concept="2tJIrI" id="7_LxsObuvq$" role="jymVt" />
<node concept="3uibUv" id="7_LxsObuvq_" role="1zkMxy">
<ref role="3uigEE" node="1IuIrLUpCCg" resolve="PlatformDeclarationBase" />
<node concept="16syzq" id="7_LxsObuvqA" role="11_B2D">
<ref role="16sUi3" node="7_LxsObuvql" resolve="T" />
</node>
</node>
<node concept="3clFb_" id="7_LxsObuvqB" role="jymVt">
<property role="TrG5h" value="remove" />
<node concept="3Tm1VV" id="7_LxsObuvqC" role="1B3o_S" />
<node concept="3cqZAl" id="7_LxsObuvqD" role="3clF45" />
<node concept="3clFbS" id="7_LxsObuvqE" role="3clF47">
<node concept="3clFbF" id="7_LxsObuvqF" role="3cqZAp">
<node concept="2OqwBi" id="7_LxsObuvqG" role="3clFbG">
<node concept="37vLTw" id="7_LxsObuvqH" role="2Oq$k0">
<ref role="3cqZAo" node="1IuIrLUoZ0z" resolve="myNode" />
</node>
<node concept="3YRAZt" id="7_LxsObuvqI" role="2OqNvi" />
</node>
</node>
</node>
<node concept="2AHcQZ" id="7_LxsObuvqJ" role="2AJF6D">
<ref role="2AI5Lk" to="wyt6:~Override" resolve="Override" />
</node>
</node>
<node concept="2tJIrI" id="7_LxsObuvqK" role="jymVt" />
<node concept="3clFb_" id="7_LxsObuvqL" role="jymVt">
<property role="TrG5h" value="getRole" />
<node concept="3Tm1VV" id="7_LxsObuvqM" role="1B3o_S" />
<node concept="2AHcQZ" id="7_LxsObuvqN" role="2AJF6D">
<ref role="2AI5Lk" to="mhfm:~Nullable" resolve="Nullable" />
</node>
<node concept="3uibUv" id="7_LxsObuvqO" role="3clF45">
<ref role="3uigEE" to="7adg:~Role" resolve="Role" />
</node>
<node concept="3clFbS" id="7_LxsObuvqP" role="3clF47">
<node concept="3clFbF" id="7_LxsObuvqQ" role="3cqZAp">
<node concept="10Nm6u" id="7_LxsObuvqR" role="3clFbG" />
</node>
</node>
<node concept="2AHcQZ" id="7_LxsObuvqS" role="2AJF6D">
<ref role="2AI5Lk" to="wyt6:~Override" resolve="Override" />
</node>
</node>
<node concept="2tJIrI" id="7_LxsObuvqT" role="jymVt" />
<node concept="3clFb_" id="7_LxsObuvqU" role="jymVt">
<property role="TrG5h" value="index" />
<node concept="3Tm1VV" id="7_LxsObuvqV" role="1B3o_S" />
<node concept="10Oyi0" id="7_LxsObuvqW" role="3clF45" />
<node concept="3clFbS" id="7_LxsObuvqX" role="3clF47">
<node concept="3clFbF" id="7_LxsObuvqY" role="3cqZAp">
<node concept="2OqwBi" id="7_LxsObuvqZ" role="3clFbG">
<node concept="37vLTw" id="7_LxsObuvr0" role="2Oq$k0">
<ref role="3cqZAo" node="1IuIrLUoZ0z" resolve="myNode" />
</node>
<node concept="2bSWHS" id="7_LxsObuvr1" role="2OqNvi" />
</node>
</node>
</node>
<node concept="2AHcQZ" id="7_LxsObuvr2" role="2AJF6D">
<ref role="2AI5Lk" to="wyt6:~Override" resolve="Override" />
</node>
</node>
<node concept="2tJIrI" id="7_LxsObuvr3" role="jymVt" />
</node>
</model>

1 change: 1 addition & 0 deletions code/library-management/.module-id
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
734aecb8-1ee0-415b-bf20-5e9c872d7019
72 changes: 72 additions & 0 deletions code/library-management/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import org.fbme.gradle.includeMpsArtifacts
import org.fbme.gradle.moduleDependency
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
// id("java")
mps
kotlin
}

//group = "org.example"
//version = "unspecified"
//
//repositories {
// mavenCentral()
//}

dependencies {
compileOnly(mpsDistribution())
compileOnly(project(":code:library"))
compileOnly(project(":code:platform"))

implementation(project(":code:language"))

testImplementation(mpsDistribution())
testImplementation(project(":code:library"))

mpsImplementation(project(":code:library", "mps"))
mpsImplementation(project(":code:language", "mps"))

// implementation(project(mapOf("path" to ":code:platform")))
// testImplementation(platform("org.junit:junit-bom:5.9.1"))
// testImplementation("org.junit.jupiter:junit-jupiter")

// compileOnly(mpsDistribution())
compileOnly(project(":code:library"))

implementation(project(":code:language"))

testImplementation(mpsDistribution())
testImplementation(project(":code:library"))

// mpsImplementation(project(":code:library", "mps"))
// mpsImplementation(project(":code:language", "mps"))
}


mps {
moduleName.set("org.fbme.platform.lib-management")
includeMpsArtifacts(project(":code:language"))
moduleDependency(project(":code:library"))
}

val compileKotlin by tasks.getting(KotlinCompile::class) {
kotlinOptions.freeCompilerArgs = listOf("-Xjvm-default=all")
}

val test by tasks.getting(Test::class) {
dependsOn(
":code:library:buildDistPlugin",
"buildDistPlugin"
)
}

val copyLibs by tasks.getting(Copy::class) {
dependsOn(":code:language:jar")
}

//tasks.test {
// useJUnitPlatform()
//}

7 changes: 7 additions & 0 deletions code/library-management/src/main/java/org/example/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package org.example;

public class Main {
public static void main(String[] args) {
System.out.println("Hello world!");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package org.fbme.ide.platform.library

import org.fbme.ide.platform.library.util.LibraryFacet
import org.jetbrains.mps.openapi.module.FacetsFacade.FacetFactory
import org.jetbrains.mps.openapi.module.SModule
import org.jetbrains.mps.openapi.module.SModuleFacet

class LibraryFacetFactory : FacetFactory {

override fun create(sModule: SModule): SModuleFacet {
return LibraryFacet(sModule)
}

override fun getPresentation(): String {
return "Library"
}

companion object {
var CUSTOM_FACET_FACTORY = LibraryFacetFactory()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
package org.fbme.ide.platform.library

import com.intellij.openapi.ui.VerticalFlowLayout
import com.intellij.ui.components.JBLabel
import com.intellij.uiDesigner.core.GridConstraints
import com.intellij.uiDesigner.core.GridLayoutManager
import com.intellij.util.ui.JBInsets
import com.intellij.util.ui.JBUI
import jetbrains.mps.ide.ui.dialogs.properties.tabs.BaseTab
import org.fbme.ide.platform.library.util.LibraryFacet
import org.jetbrains.mps.openapi.module.SModuleFacet
import org.jetbrains.mps.openapi.ui.persistence.FacetTab
import java.awt.Dimension
import javax.swing.BorderFactory
import javax.swing.JLabel
import javax.swing.JPanel
import javax.swing.JTextField

class LibraryFacetTab(val moduleFacet: LibraryFacet): BaseTab(), FacetTab {
private var myTextField: JTextField? = null

private fun displayAllNamespaces() {
val namespacesPanel = JPanel(VerticalFlowLayout())
moduleFacet.getAllNamespaces().forEach { (node, namespace) ->
val label = JLabel("Node ID: ${node.nodeId}, Name: ${node.name}, Namespace: $namespace")
label.border = BorderFactory.createEmptyBorder(10, 10, 10, 10) // Add space around the label
namespacesPanel.add(label)
}
tabComponent.add(namespacesPanel)
}

override fun init() {
val content = JPanel()
content.setLayout(GridLayoutManager(1, 2, JBUI.emptyInsets(), -1, -1))

val label = JBLabel("Plugin ID:")
content.add(
label, GridConstraints(
0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED,
GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false
)
)

myTextField = JTextField("ID")
myTextField!!.isEditable = false

content.add(
myTextField, GridConstraints(
0,
1,
1,
1,
GridConstraints.ANCHOR_WEST,
GridConstraints.FILL_HORIZONTAL,
GridConstraints.SIZEPOLICY_CAN_GROW,
GridConstraints.SIZEPOLICY_FIXED,
null,
null,
null,
0,
false
)
)

val outerPanel = JPanel()
outerPanel.setLayout(GridLayoutManager(1, 1, JBInsets(10, 10, 10, 10), -1, -1))
outerPanel.add(
content,
GridConstraints(
0,
0,
1,
1,
GridConstraints.ANCHOR_NORTHWEST,
GridConstraints.FILL_HORIZONTAL,
GridConstraints.SIZEPOLICY_WANT_GROW,
GridConstraints.SIZEPOLICY_FIXED,
null,
Dimension(150, -1),
null,
0,
false
)
)

displayAllNamespaces()

tabComponent = outerPanel
}

override fun isModified(): Boolean {
TODO("Not yet implemented")
}

override fun apply() {
TODO("Not yet implemented")
}

override fun getFacet(): SModuleFacet {
return moduleFacet
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.fbme.ide.platform.library

import org.fbme.ide.platform.library.util.LibraryFacet
import org.fbme.ide.platform.library.LibraryFacetTab
import org.jetbrains.mps.openapi.ui.persistence.FacetTab
import org.jetbrains.mps.openapi.ui.persistence.TabFactory


class LibraryFacetTabFactory : TabFactory<LibraryFacet?> {
override fun getTab(moduleFacet: LibraryFacet?): FacetTab {
return LibraryFacetTab(moduleFacet!!)
}
}
Loading