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

Open
wants to merge 1 commit into
base: master
Choose a base branch
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
Contributor

@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)
Copy link
Contributor

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"

Copy link
Contributor

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
Copy link
Contributor

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()) {
Copy link
Contributor

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
Copy link
Contributor

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
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;

Copy link
Contributor

Choose a reason for hiding this comment

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

empty diff

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

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?

}

return false;
}
Copy link
Contributor

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) {
Copy link
Contributor

Choose a reason for hiding this comment

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

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

}
}
Copy link
Contributor

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
Copy link
Contributor

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)

}

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

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?

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