Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
sarah.grebing
ProofScriptParser
Commits
2ce23e4b
Commit
2ce23e4b
authored
Jun 08, 2017
by
Sarah Grebing
Browse files
Empty TabPane (not final yet)
parent
311f08d3
Pipeline
#11029
failed with stage
in 2 minutes and 26 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/edu/kit/formal/gui/controller/DebuggerMainWindowController.java
View file @
2ce23e4b
...
...
@@ -4,10 +4,7 @@ import de.uka.ilkd.key.logic.op.IProgramMethod;
import
de.uka.ilkd.key.pp.ProgramPrinter
;
import
de.uka.ilkd.key.proof.init.ProofInputException
;
import
de.uka.ilkd.key.speclang.Contract
;
import
edu.kit.formal.gui.controls.GoalOptionsMenu
;
import
edu.kit.formal.gui.controls.JavaArea
;
import
edu.kit.formal.gui.controls.ScriptArea
;
import
edu.kit.formal.gui.controls.SequentView
;
import
edu.kit.formal.gui.controls.*
;
import
edu.kit.formal.gui.model.RootModel
;
import
edu.kit.formal.interpreter.Interpreter
;
import
edu.kit.formal.interpreter.InterpreterBuilder
;
...
...
@@ -211,7 +208,7 @@ public class DebuggerMainWindowController implements Initializable {
});
goalView
.
setCellFactory
(
GoalNodeListCell:
:
new
);
CustomTabPaneSkin
skin
=
new
CustomTabPaneSkin
(
tabPane
);
startTab
.
textProperty
().
bind
(
new
StringBinding
()
{
{
super
.
bind
(
model
.
scriptFileProperty
());
...
...
src/main/java/edu/kit/formal/gui/controls/CustomTabPaneSkin.java
0 → 100644
View file @
2ce23e4b
package
edu.kit.formal.gui.controls
;
import
com.sun.javafx.scene.control.skin.TabPaneSkin
;
import
javafx.scene.Node
;
import
javafx.scene.control.TabPane
;
import
javafx.scene.layout.Pane
;
/**
* A way to display a custom tab when tab pane is empty
* from https://stackoverflow.com/questions/35239420/display-label-if-tabpane-has-no-tabs
*/
public
class
CustomTabPaneSkin
extends
TabPaneSkin
{
//private final VBox placeHolder;
//private final Label placeHolderText;
private
final
PlaceHolderTab
placeHolder
;
public
CustomTabPaneSkin
(
TabPane
tabPane
)
{
super
(
tabPane
);
placeHolder
=
new
PlaceHolderTab
();
//placeHolderText = new Label( "Empty" );
//placeHolderText.setFont( Font.font( null, FontWeight.BOLD, 20 ) );
//placeHolderText.setAlignment( Pos.CENTER );
//placeHolderText.minWidthProperty().bind( getSkinnable().widthProperty() );
//placeHolderText.minHeightProperty().bind( getSkinnable().heightProperty() );
//placeHolder = new VBox( placeHolderText );
placeHolder
.
minWidthProperty
().
bind
(
getSkinnable
().
widthProperty
());
placeHolder
.
minHeightProperty
().
bind
(
getSkinnable
().
heightProperty
());
for
(
Node
node
:
getChildren
())
{
if
(
node
.
getStyleClass
().
contains
(
"tab-header-area"
))
{
Pane
headerArea
=
(
Pane
)
node
;
// Header area is hidden if there is no tabs, thus when the tabpane is "empty"
headerArea
.
visibleProperty
().
addListener
((
observable
,
oldValue
,
newValue
)
->
{
if
(
newValue
)
{
getChildren
().
remove
(
placeHolder
);
}
else
{
getChildren
().
add
(
placeHolder
);
}
}
);
break
;
}
}
}
public
PlaceHolderTab
getPlaceHolder
()
{
return
placeHolder
;
}
}
src/main/java/edu/kit/formal/gui/controls/PlaceHolderTab.java
0 → 100644
View file @
2ce23e4b
package
edu.kit.formal.gui.controls
;
import
javafx.geometry.Insets
;
import
javafx.scene.control.Button
;
import
javafx.scene.layout.VBox
;
/**
* Replacement for empty Tab with two buttons
*/
public
class
PlaceHolderTab
extends
VBox
{
private
final
Button
newScript
=
new
Button
(
"New Script"
);
private
final
Button
openScript
=
new
Button
(
"Open Script"
);
public
PlaceHolderTab
()
{
this
.
setPadding
(
new
Insets
(
10
,
50
,
50
,
50
));
this
.
setSpacing
(
10
);
this
.
getChildren
().
add
(
newScript
);
this
.
getChildren
().
add
(
openScript
);
}
public
Button
getNewScript
()
{
return
newScript
;
}
public
Button
getOpenScript
()
{
return
openScript
;
}
}
src/main/java/edu/kit/formal/gui/controls/TabPaneScriptArea.java
0 → 100644
View file @
2ce23e4b
package
edu.kit.formal.gui.controls
;
import
javafx.fxml.FXMLLoader
;
import
javafx.scene.layout.VBox
;
import
java.io.IOException
;
/**
* Created by sarah on 6/8/17.
*/
public
class
TabPaneScriptArea
extends
VBox
{
public
TabPaneScriptArea
()
{
super
();
FXMLLoader
loader
=
new
FXMLLoader
(
getClass
().
getResource
(
"SectionPane.fxml"
));
loader
.
setRoot
(
this
);
loader
.
setController
(
this
);
try
{
loader
.
load
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
src/main/resources/DebuggerMain.fxml
View file @
2ce23e4b
...
...
@@ -97,7 +97,7 @@
</Button>
</items>
</ToolBar>
<TabPane
fx:id=
"tabPane"
side=
"left"
<TabPane
fx:id=
"tabPane"
side=
"left"
styleClass=
"tab-pane"
tabClosingPolicy=
"SELECTED_TAB"
VBox.vgrow=
"ALWAYS"
>
<tabs>
<Tab
fx:id=
"startTab"
text=
"Untitled"
>
...
...
src/main/resources/edu/kit/formal/gui/controls/TabPaneScriptArea.fxml
0 → 100644
View file @
2ce23e4b
<?xml version="1.0" encoding="UTF-8"?>
<?import edu.kit.formal.gui.controls.ScriptArea?>
<?import javafx.scene.control.Tab?>
<?import javafx.scene.control.TabPane?>
<?import javafx.scene.layout.*?>
<fx:root
xmlns:fx=
"http://javafx.com/fxml/1"
prefHeight=
"100"
prefWidth=
"250"
styleClass=
"tab-pane"
type=
"javafx.scene.layout.BorderPane"
xmlns=
"http://javafx.com/javafx/8.0.112"
>
<VBox>
<TabPane
fx:id=
"tabPane"
side=
"left"
tabClosingPolicy=
"SELECTED_TAB"
VBox.vgrow=
"ALWAYS"
>
<tabs>
<Tab
fx:id=
"startTab"
text=
"Untitled"
>
<content>
<ScriptArea
fx:id=
"scriptArea"
VBox.vgrow=
"ALWAYS"
/>
</content>
</Tab>
</tabs>
</TabPane>
</VBox>
</fx:root>
\ No newline at end of file
src/main/resources/edu/kit/formal/gui/debugger-ui.less
View file @
2ce23e4b
...
...
@@ -195,4 +195,8 @@
.header-buttons .button {
}
}
.tab-pane {
-fx-skin: "edu.kit.formal.gui.controls.CustomTabPaneSkin";
}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment