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

Change the classes with shortcut #2413

Closed
wants to merge 0 commits into from

Conversation

jannisCode
Copy link
Contributor

@jannisCode jannisCode commented Oct 17, 2024

This PR finishes the PR started by @Wittmaxi , who also did most of the work here: #1874
The objective of @Wittmaxi ´s PR is to be able to expand the functionality of the nextTab shortcut (default crtl + pgdown) so that after reaching the last tab, one more click changes the active tab back to the first one.

What this PR does

When there are too many tabs open, #1874 still went back to the first tab, ignoring the remaining tabs stored in the chevron (the >> container).
image
With the changes from this PR, when there are stored tabs in the chevron, clicking once more after the last tab has the same functionality as the default eclipse, going into the chevron.

tabaction.mp4

@jannisCode jannisCode force-pushed the tab_change branch 4 times, most recently from 21d07b3 to 402bd75 Compare October 17, 2024 08:53
Copy link
Contributor

github-actions bot commented Oct 17, 2024

Test Results

 1 821 files  ±0   1 821 suites  ±0   1h 52m 18s ⏱️ + 6m 53s
 7 724 tests ±0   7 495 ✅ ±0  228 💤 ±0  1 ❌ ±0 
24 333 runs  ±0  23 585 ✅ ±0  747 💤 ±0  1 ❌ ±0 

For more details on these failures, see this check.

Results for commit 473cefe. ± Comparison against base commit 136afb4.

♻️ This comment has been updated with latest results.

Copy link

@Wittmaxi Wittmaxi left a comment

Choose a reason for hiding this comment

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

Small nitpicks. I can check functionality later and merge if it works

*
* @param folder
* @return if there are any items which are not shown in the folder (tabs in the
* >> column)

Choose a reason for hiding this comment

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

the ">> column" is called "the chevron"

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

/**
* checks if there are any hidden items
*
* @param folder

Choose a reason for hiding this comment

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

please describe further

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

* >> column)
*/
private boolean areHiddenItems(CTabFolder folder) {
for (CTabItem i : folder.getItems()) {

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

/**
* Sets the current selection to the second-to-last item in the given direction.
*
* @param folder

Choose a reason for hiding this comment

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

describe folder and forward

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@jannisCode jannisCode force-pushed the tab_change branch 10 times, most recently from e40fc60 to bb64c62 Compare October 22, 2024 14:02
jannisCode added a commit to jannisCode/eclipse.platform.ui that referenced this pull request Oct 23, 2024
Tab change can now handle the chevron. And after reaching the last tab,
it jumps to the first, if chevron doesn´t exist

eclipse-platform#2413
jannisCode added a commit to jannisCode/eclipse.platform.ui that referenced this pull request Oct 25, 2024
Tab change can now handle the chevron. And after reaching the last tab,
it jumps to the first, if chevron doesn´t exist

eclipse-platform#2413
jannisCode added a commit to jannisCode/eclipse.platform.ui that referenced this pull request Oct 25, 2024
Tab change can now handle the chevron. And after reaching the last tab,
it jumps to the first, if chevron doesn´t exist

eclipse-platform#2413
jannisCode added a commit to jannisCode/eclipse.platform.ui that referenced this pull request Oct 28, 2024
Tab change can now handle the chevron. And after reaching the last tab,
it jumps to the first, if chevron doesn´t exist

eclipse-platform#2413
jannisCode added a commit to jannisCode/eclipse.platform.ui that referenced this pull request Nov 5, 2024
Tab change can now handle the chevron. And after reaching the last tab,
it jumps to the first, if chevron doesn´t exist

eclipse-platform#2413
jannisCode added a commit to jannisCode/eclipse.platform.ui that referenced this pull request Nov 5, 2024
Tab change can now handle the chevron. And after reaching the last tab,
it jumps to the first, if chevron doesn´t exist

eclipse-platform#2413
@jannisCode jannisCode marked this pull request as ready for review November 5, 2024 16:33
Control control = focusControl;

Choose a reason for hiding this comment

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

empty diff

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

do {
if (control instanceof CTabFolder folder && isFinalItemInCTabFolder(folder, forward)
&& !areHiddenItems(folder)) {
loopToSecondToFirstItemInCTabFolder(folder, forward);

Choose a reason for hiding this comment

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

"loopToSecondToFirstItemInCTabFolder" is not a desirable name. Are you referring to the "second to last" item or to the "second" item?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

}

return false;
}

Choose a reason for hiding this comment

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

by convention, please add a line here

return null;
}

private boolean areHiddenItems(CTabFolder folder) {
CTabItem[] items = folder.getItems();
for (CTabItem i : items) {

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -70,5 +124,4 @@ protected Method getMethodToExecute() {
}
return null;
}

}
}

Choose a reason for hiding this comment

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

please keep the diff clean

}
}

/**https://github.com/jannisCode/eclipse.jdt.ui.git

Choose a reason for hiding this comment

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

By convention, the first line of javadoc comments is empty (atleast that's what I have seen everywhere else)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

}

/**
* Sets the current selection to the second-to-last item in the given direction.

Choose a reason for hiding this comment

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

second to last? or second to first?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

jannisCode added a commit to jannisCode/eclipse.platform.ui that referenced this pull request Nov 19, 2024
Tab change can now handle the chevron. And after reaching the last tab,
it jumps to the first, if chevron doesn´t exist

eclipse-platform#2413
jannisCode added a commit to jannisCode/eclipse.platform.ui that referenced this pull request Nov 19, 2024
Tab change can now handle the chevron. And after reaching the last tab,
it jumps to the first, if chevron doesn´t exist

eclipse-platform#2413
jannisCode added a commit to jannisCode/eclipse.platform.ui that referenced this pull request Nov 19, 2024
Tab change can now handle the chevron. And after reaching the last tab,
it jumps to the first, if chevron doesn´t exist

eclipse-platform#2413
@jannisCode jannisCode force-pushed the tab_change branch 2 times, most recently from 3e7bafa to aa3f7d1 Compare November 19, 2024 09:36
@jannisCode jannisCode closed this Nov 19, 2024
jannisCode added a commit to jannisCode/eclipse.platform.ui that referenced this pull request Nov 19, 2024
Tab change can now handle the chevron. And after reaching the last tab,
it jumps to the first, if chevron doesn´t exist
jannisCode added a commit to jannisCode/eclipse.platform.ui that referenced this pull request Nov 19, 2024
Tab change can now handle the chevron. And after reaching the last tab,
it jumps to the first, if chevron doesn´t exist
jannisCode added a commit to jannisCode/eclipse.platform.ui that referenced this pull request Nov 19, 2024
Tab change can now handle the chevron. And after reaching the last tab,
it jumps to the first, if chevron doesn´t exist
jannisCode added a commit to jannisCode/eclipse.platform.ui that referenced this pull request Nov 19, 2024
Tab change can now handle the chevron. And after reaching the last tab,
it jumps to the first, if chevron doesn´t exist
jannisCode added a commit to jannisCode/eclipse.platform.ui that referenced this pull request Nov 19, 2024
Tab change can now handle the chevron. And after reaching the last tab,
it jumps to the first, if chevron doesn´t exist
jannisCode added a commit to jannisCode/eclipse.platform.ui that referenced this pull request Nov 19, 2024
Tab change can now handle the chevron. And after reaching the last tab,
it jumps to the first, if chevron doesn´t exist
jannisCode added a commit to jannisCode/eclipse.platform.ui that referenced this pull request Nov 25, 2024
Tab change can now handle the chevron. And after reaching the last tab,
it jumps to the first, if chevron doesn´t exist
jannisCode added a commit to jannisCode/eclipse.platform.ui that referenced this pull request Nov 25, 2024
Tab change can now handle the chevron. And after reaching the last tab,
it jumps to the first, if chevron doesn´t exist
jannisCode added a commit to jannisCode/eclipse.platform.ui that referenced this pull request Dec 3, 2024
Tab change can now handle the chevron. And after reaching the last tab,
it jumps to the first, if chevron doesn´t exist
jannisCode added a commit to jannisCode/eclipse.platform.ui that referenced this pull request Dec 3, 2024
Tab change can now handle the chevron. And after reaching the last tab,
it jumps to the first, if chevron doesn´t exist
jannisCode added a commit to jannisCode/eclipse.platform.ui that referenced this pull request Dec 6, 2024
Tab change can now handle the chevron. And after reaching the last tab,
it jumps to the first, if chevron doesn´t exist
jannisCode added a commit to jannisCode/eclipse.platform.ui that referenced this pull request Dec 9, 2024
Tab change can now handle the chevron. And after reaching the last tab,
it jumps to the first, if chevron doesn´t exist
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.

2 participants