Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
sarah.grebing
ProofScriptParser
Commits
55375f3a
Commit
55375f3a
authored
Jun 08, 2017
by
Sarah Grebing
Browse files
Empty tab pane has buttons now, need to add the appropriate Action
parent
2ce23e4b
Pipeline
#11045
failed with stage
in 3 minutes and 3 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/edu/kit/formal/gui/controls/CustomTabPaneSkin.java
View file @
55375f3a
package
edu.kit.formal.gui.controls
;
import
com.sun.javafx.scene.control.skin.TabPaneSkin
;
import
javafx.geometry.Pos
;
import
javafx.scene.Node
;
import
javafx.scene.control.TabPane
;
import
javafx.scene.layout.Pane
;
...
...
@@ -19,16 +20,9 @@ public class CustomTabPaneSkin extends TabPaneSkin {
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
());
placeHolder
.
getVbox
().
minWidthProperty
().
bind
(
getSkinnable
().
widthProperty
());
placeHolder
.
getVbox
().
minHeightProperty
().
bind
(
getSkinnable
().
heightProperty
());
placeHolder
.
getVbox
().
setAlignment
(
Pos
.
CENTER
);
for
(
Node
node
:
getChildren
())
{
if
(
node
.
getStyleClass
().
contains
(
"tab-header-area"
))
{
...
...
src/main/java/edu/kit/formal/gui/controls/PlaceHolderTab.java
View file @
55375f3a
package
edu.kit.formal.gui.controls
;
import
javafx.geometry.
Inset
s
;
import
javafx.geometry.
Po
s
;
import
javafx.scene.control.Button
;
import
javafx.scene.layout.FlowPane
;
import
javafx.scene.layout.VBox
;
/**
* Replacement for empty Tab with two buttons
*/
public
class
PlaceHolderTab
extends
VBox
{
public
class
PlaceHolderTab
extends
FlowPane
{
/**
* Button to open a new script
*/
private
final
Button
newScript
=
new
Button
(
"New Script"
);
/**
* Button to open a script
*/
private
final
Button
openScript
=
new
Button
(
"Open Script"
);
private
VBox
vbox
;
/**
* Pane holding the buttons for an empty tab
*/
public
PlaceHolderTab
()
{
this
.
setPadding
(
new
Insets
(
10
,
50
,
50
,
50
));
this
.
setSpacing
(
10
);
vbox
=
new
VBox
();
newScript
.
setMaxSize
(
Double
.
MAX_VALUE
,
Double
.
MAX_VALUE
);
openScript
.
setMaxSize
(
Double
.
MAX_VALUE
,
Double
.
MAX_VALUE
);
newScript
.
setAlignment
(
Pos
.
CENTER
);
openScript
.
setAlignment
(
Pos
.
CENTER
);
vbox
.
getChildren
().
add
(
newScript
);
vbox
.
getChildren
().
add
(
openScript
);
vbox
.
setAlignment
(
Pos
.
CENTER
);
this
.
getChildren
().
add
(
vbox
);
}
this
.
getChildren
().
add
(
newScript
);
this
.
getChildren
().
add
(
openScript
)
;
public
VBox
getVbox
()
{
return
vbox
;
}
public
Button
getNewScript
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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