Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JFXTabPane no tab closing button #75

Closed
zwaldeck opened this issue Mar 27, 2016 · 20 comments
Closed

JFXTabPane no tab closing button #75

zwaldeck opened this issue Mar 27, 2016 · 20 comments

Comments

@zwaldeck
Copy link

What I really miss and I cant get it to work is a closing button on a Tab in the JFXTabPane.
Is this a known issue or is there a work around?

@jfoenixadmin
Copy link
Collaborator

jfoenixadmin commented Apr 5, 2016

yeah , it's a known issue, it's planned to be implemented.

evan8diab pushed a commit to evan8diab/JFoenix that referenced this issue Nov 3, 2016
@badarshahzad
Copy link
Contributor

I have same issue could you please tell me is this resolve or not?

@jfoenixadmin
Copy link
Collaborator

well this issue is not resolved yet in master branch, this issue is more of a design issue.
We need a material design behavior to integrate the close button in JFXTabPane, otherwise it feels off in the header.

Feel free to suggest any design for this issue and contribute to JFonenix.

Regards,

@bschaeublin
Copy link

bschaeublin commented Jul 21, 2017

@jfoenixadmin, take a look on this plunkr example (not mine):
http://plnkr.co/edit/PupIBn?p=preview

It could be an idea, how to place the close button. Would be great, if we could have this feature soon!
I love your work so far, thanks!

Edit; I made a workaround with a contextmenu (close, close all, close all but this) (does work for my desktop application, but may be wrong for mobile/web/touch applications)

@skmedix
Copy link
Collaborator

skmedix commented Sep 17, 2017

Bump @jfoenixadmin
I think that example above is a good solution. This issue is already 1.5yr old and should be taken as a higher priority. This is frequently asked feature.

#241 solution is not that bad, it just needs some style improvements and change to JFXButton (minus cast reduction which is unnecessary)
#192 can be closed as it's incomplete, very old and the author is not replying.

@jfoenixadmin
Copy link
Collaborator

Well @skmedix, #241 is a good implementation (having a close policy) however the ui feels off.

Maybe the 'X' button should be part of the tab content or should only appear when holding the tab title,
Not sure if this is the right design / behavior. A designer opinion here would be appreciated before closing this issue.

Regards,

@aromanelli
Copy link

Reading off of https://material.io/components/android/catalog/tab-layout/, the sentence "the Material Design guidelines for individual tabs is done in the tabs themselves" seems to suggest that the closing of the tab should be handled from within the individual tab content, and not the tab directly.

An alternative would be a long-press on the tab to have a close button/menu appear, but that would be problematic if the tab size horizontally is small/limited.

@skmedix
Copy link
Collaborator

skmedix commented Feb 5, 2018

@jfoenixadmin Soon we will have an official solution.
image

@jfoenixadmin
Copy link
Collaborator

jfoenixadmin commented Feb 23, 2018

Cool, however I think they will simply add 'x' button right next to the tab title xD

@jfoenixadmin
Copy link
Collaborator

Hello, I pushed an updated for JFXTabPane to support CLOSE_ALL_TABS policy.
I might update it later once the official solution is out.

Regards,

@alamenai
Copy link

As a temporarry solution ,You can add a ContextMenu to each tab like this example :

tabpane.getTabs().stream().forEach(tab->{  
ContextMenu contextMenu=new ContextMenu();
MenuItem closeItem=new MenuItem();
closeItem.setOnAction(actionEvent->{ tabPane.getTabs().remove(tab);});
contextMenu.getItems().add(closeItem);
tab.setContextMenu(contextMenu);
}

@God-Hand
Copy link

How to build this project?
where and how to use com.sun.javafx ??

@God-Hand
Copy link

can u help me? pls sir,

@jfoenixadmin
Copy link
Collaborator

you can build JFoenix by running gradle build using the following command gradlew build

@God-Hand
Copy link

i have tried that ,but it didn't work

@skmedix
Copy link
Collaborator

skmedix commented Apr 24, 2018

@God-Hand Just make a new Issue for that.

@jfoenixadmin
Copy link
Collaborator

will close this issue as JFXTabPane now supports CLOSE_ALL_TABS policy

@badarshahzad
Copy link
Contributor

😄 👍 after long... time this issue was rise. it solved now... 👋

@God-Hand
Copy link

thnx

@ghost
Copy link

ghost commented Sep 11, 2018

Hello,
how to change color of close button?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants