Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

ServerSettings.java 2.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * Copyright (c) 2006-2011 Chris Smith, Shane Mc Cormack, Gregory Holmes,
  3. * Simon Mott
  4. *
  5. * Permission is hereby granted, free of charge, to any person obtaining a copy
  6. * of this software and associated documentation files (the "Software"), to deal
  7. * in the Software without restriction, including without limitation the rights
  8. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. * copies of the Software, and to permit persons to whom the Software is
  10. * furnished to do so, subject to the following conditions:
  11. *
  12. * The above copyright notice and this permission notice shall be included in
  13. * all copies or substantial portions of the Software.
  14. *
  15. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  21. * SOFTWARE.
  22. */
  23. package com.dmdirc.commandparser.commands.server;
  24. import com.dmdirc.FrameContainer;
  25. import com.dmdirc.commandparser.BaseCommandInfo;
  26. import com.dmdirc.commandparser.CommandArguments;
  27. import com.dmdirc.commandparser.CommandInfo;
  28. import com.dmdirc.commandparser.CommandType;
  29. import com.dmdirc.commandparser.commands.Command;
  30. import com.dmdirc.commandparser.commands.CommandOptions;
  31. import com.dmdirc.commandparser.commands.IntelligentCommand;
  32. import com.dmdirc.commandparser.commands.context.CommandContext;
  33. import com.dmdirc.commandparser.commands.context.ServerCommandContext;
  34. import com.dmdirc.ui.input.AdditionalTabTargets;
  35. /**
  36. * Opens the server settings window for the server.
  37. *
  38. * @since 0.6.4
  39. */
  40. @CommandOptions(allowOffline=false)
  41. public class ServerSettings extends Command implements IntelligentCommand {
  42. /** A command info object for this command. */
  43. public static final CommandInfo INFO = new BaseCommandInfo("serversettings",
  44. "serversettings - opens the server settings window",
  45. CommandType.TYPE_SERVER);
  46. /** {@inheritDoc} */
  47. @Override
  48. public void execute(final FrameContainer origin,
  49. final CommandArguments args, final CommandContext context) {
  50. context.getSource().getController().showServerSettingsDialog(
  51. ((ServerCommandContext) context).getServer());
  52. }
  53. /** {@inheritDoc} */
  54. @Override
  55. public AdditionalTabTargets getSuggestions(final int arg,
  56. final IntelligentCommandContext context) {
  57. return new AdditionalTabTargets().excludeAll();
  58. }
  59. }