I am trying to make a help menu with pages for my plugin. I found this class in the apidocs. http://jd.bukkit.org/apidocs/org/bukkit ... tPage.html
I was curious how it works and if it would save me some time in the future. So, my question, how exactly would this work for creating a paged help menu ? Would it really save time ?
[JAVA][BUKKIT] ChatPagniator
Re: [JAVA][BUKKIT] ChatPagniator
It looks like it returns a portion of the array for the given page number, so it that should be pretty useful for creating pages I've not used it personally but you should be able to using it directly with a CommandSender
sender.sendMessage(ChatPaginator.ChatPage(helpLines));you could also look how it's used in the /help command.
Re: [JAVA][BUKKIT] ChatPagniator
Yes I have looked at that, however, it seems as though it becomes overly complicated for a simple task that I am going for. This is how I set it up currently:jacek wrote:It looks like it returns a portion of the array for the given page number, so it that should be pretty useful for creating pages I've not used it personally but you should be able to using it directly with a CommandSender
sender.sendMessage(ChatPaginator.ChatPage(helpLines));you could also look how it's used in the /help command.
String[] lines = new String[msg.size()]; ChatPage page = new ChatPage(msg.toArray(lines), 1, 4);I am unsure how to send a player a specific page though.
As a side note, I ticked "notify me when reply is posted" and I did not receive any email when you replied to this post, assuming that is the purpose of that checkbox.. )
Re: [JAVA][BUKKIT] ChatPagniator
ChatPage has getLines() which should be all of the lines that are meant to appear on that page. There is also getPageNumber() and getTotalPages() which could be useful for a nice header
Urg, spam filters usually.exload wrote:As a side note, I ticked "notify me when reply is posted" and I did not receive any email when you replied to this post, assuming that is the purpose of that checkbox.. )
Re: [JAVA][BUKKIT] ChatPagniator
Oh. I was thinking this class had an entirely different function and ability. My hope was to send it a huge arraylist of messages that I wanted it to display. It would have the amount of lines per page as a parameter. Then once you created an instance of this class you would be able to access methods such as getPage(id), getTotalPages(), and getPageNumber().jacek wrote:ChatPage has getLines() which should be all of the lines that are meant to appear on that page. There is also getPageNumber() and getTotalPages() which could be useful for a nice header
Urg, spam filters usually.exload wrote:As a side note, I ticked "notify me when reply is posted" and I did not receive any email when you replied to this post, assuming that is the purpose of that checkbox.. )
Something along those lines.
I have tried creating my own class to do this function but I ran into several issues when sending a page based on permissions a user had.
Also I searched through my spam and could not find any notification from this site.
Re: [JAVA][BUKKIT] ChatPagniator
I think it does that, you get the ChatPage for the page you want then the lines on that page are getLines()exload wrote:Oh. I was thinking this class had an entirely different function and ability. My hope was to send it a huge arraylist of messages that I wanted it to display. It would have the amount of lines per page as a parameter. Then once you created an instance of this class you would be able to access methods such as getPage(id), getTotalPages(), and getPageNumber().
Something along those lines.
@live.com by any chance ? They are often out right rejected too.exload wrote:Also I searched through my spam and could not find any notification from this site.
Re: [JAVA][BUKKIT] ChatPagniator
Yes, however, when I send the player the lines in getLines() it sends every line that I have in my ArrayList.jacek wrote:I think it does that, you get the ChatPage for the page you want then the lines on that page are getLines()exload wrote:Oh. I was thinking this class had an entirely different function and ability. My hope was to send it a huge arraylist of messages that I wanted it to display. It would have the amount of lines per page as a parameter. Then once you created an instance of this class you would be able to access methods such as getPage(id), getTotalPages(), and getPageNumber().
Something along those lines.
@live.com by any chance ? They are often out right rejected too.exload wrote:Also I searched through my spam and could not find any notification from this site.
I am still not seeing anything from @live.com.
Re: [JAVA][BUKKIT] ChatPagniator
In that case, it seems pretty useless :sexload wrote:Yes, however, when I send the player the lines in getLines() it sends every line that I have in my ArrayList.
I'm not planning on doing anything about it, Microsoft need to be less strictexload wrote:I am still not seeing anything from @live.com.
Re: [JAVA][BUKKIT] ChatPagniator
I think I will just continue with making my own class to do this function then Thanks for your help!jacek wrote:In that case, it seems pretty useless :sexload wrote:Yes, however, when I send the player the lines in getLines() it sends every line that I have in my ArrayList.
I'm not planning on doing anything about it, Microsoft need to be less strictexload wrote:I am still not seeing anything from @live.com.