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

Moving TabFolderLayout into SWT. #1402

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

deepika-u
Copy link
Contributor

@deepika-u deepika-u commented Aug 13, 2024

Moving TabFolderLayout into SWT.

Fixes #1317

This pr needs to be merged first and later eclipse-platform/eclipse.platform.ui#2186

Copy link
Contributor

github-actions bot commented Aug 13, 2024

Test Results

  284 files   -   201    284 suites   - 201   4m 56s ⏱️ - 3m 55s
4 158 tests ±    0  4 150 ✅ +    1   8 💤 ± 0  0 ❌  - 1 
8 246 runs   - 8 140  8 188 ✅  - 8 105  58 💤  - 34  0 ❌  - 1 

Results for commit 314211c. ± Comparison against base commit 02e20d6.

♻️ This comment has been updated with latest results.

@deepika-u
Copy link
Contributor Author

deepika-u commented Sep 16, 2024

@laeubi @merks : Can this pr be merged? or anything else needs to be done?

@merks
Copy link
Contributor

merks commented Sep 16, 2024

Has this been rebased on master?

I see this as the current version of SWT:

image

@laeubi
Copy link
Contributor

laeubi commented Sep 17, 2024

Has this been rebased on master?

Done!

Copy link
Member

@akurtakov akurtakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class totally lacks documentation compared to rest of SWT. From just looking at it I have zero clue what/why/how/when to use it. Please add proper documentation before it can be accepted in SWT.

@laeubi
Copy link
Contributor

laeubi commented Sep 17, 2024

This class totally lacks documentation compared to rest of SWT.

Can you be more specific?

I have zero clue what/why/how/when to use it

e.g I see this

This layout controls the position and size
of the children of a tab folder.

As explained in the referenced issues, this is somehow not often used directly (but not prohibited of course) if I look for example at CTabFolderLayout it has similar (quite basic) documentation.

So while better documentation is always good, I think its hard to ask the person that wants to help deduplication to do it, so I would more see this as something for all SWT/Platform commiters to enhance after we have deduplicated the code if there are anything left that is really unclear in its usage.

*
* @since 3.127
*/
class TabFolderLayout extends Layout {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this really be package private?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@deepika-u You haven't answered here? How is this supposed to be used from platform.ui?

Copy link
Contributor Author

@deepika-u deepika-u Sep 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah totally agree when no modifier is mentioned it'll be defaulted to private. For this class to be available for platform.ui it needs to be public. It is done now.

Copy link
Contributor

@laeubi laeubi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be good if this PR would include setting this layout in the TabFolder as a default layout, this would also make it more clear how/when/why use it.

If it should be package private I think it needs to reside in the same package as TabFolder

@akurtakov
Copy link
Member

akurtakov commented Sep 17, 2024

Well, I still don't understand what the effects of using this one are.
P.S. Don't even get me started on all C(ustom)* widgets and friends - they should be deleted IMO.

@akurtakov
Copy link
Member

Also looking into the issue all the classes that are to be deduplicated are "internal" so they are not supposed to be generally useful which explains (to some extend) lack of documentation. I don't ask for big documentation but at least some basic one on what the effects of using it are.

@laeubi
Copy link
Contributor

laeubi commented Sep 17, 2024

Well, I still don't understand what the effects of using this one are.

The effect is that otherwise you get randomly wrong display of Tabs, see

Today I debugged some issues with TabFolder and noticed that it at least behaves strange if tabs are added dynamically, after investigate a little bit more I tried to fix it with an own Layout as usual layout mangers (like FillLayout) get sometimes confused as TabFolder has more childs than are actually displayed.

so they are not supposed to be generally useful

If they are not generally useful why we have 6 copies of the same code? ;-)

@akurtakov
Copy link
Member

One more observation this seems to be used with CTabFolder from the platform.ui rather than TabFolder. What happens when used with TabFolder (some screenshots please)? It should be clear whether it's for one or the other or both TabFolders and if the later maybe clarified in the name.

@laeubi
Copy link
Contributor

laeubi commented Sep 17, 2024

I use it for TabFolder (like reported on the issue), but the layout can be used for any component that wants TabFolder-Like behaviour (e.g. only showing all component at the full size of the composite stacked onto each other)

@akurtakov
Copy link
Member

I use it for TabFolder (like reported on the issue), but the layout can be used for any component that wants TabFolder-Like behaviour (e.g. only showing all component at the full size of the composite stacked onto each other)

Consider putting such an explanation as a class comment :)

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

Successfully merging this pull request may close these issues.

Move TabFolderLayout into SWT and set it as a default in TabFolder
4 participants