Multipurpose button



  • We've all written code to use a button to initiate some action. You press the button, and some callback is triggered to do some task. The key is one logical action per button. If you need 2 logical actions, you have one button for each. It's easy for the user to follow what's going on.

    Today, I encountered the multi purpose button. It is used in conjunction with a JTable (Java). Depending on the columns and rows selected, it can do any of 22 different actions.

    I offer the following (annonymized) horror:

    // Assume: selectedRowList is populated independently of this
    

    JButton multiPurposeButton = new JButton("Do Stuff");

    multiPurposeButton.setAction(new AbstractAction("Do Stuff") {
    private static final long serialVersionUID = 1L;

    public void actionPerformed(ActionEvent e) {
    if (colInTableIsSelected("Col A"))
    doStuffForColA();
    else if (colInTableIsSelected("Col B"))
    doStuffForColB();
    else if (colInTableIsSelected("Col C"))
    doStuffForColC();
    else if (colInTableIsSelected("Col D"))
    doStuffForColD();
    else if (colInTableIsSelected("Col E"))
    doStuffForColE();
    }
    });

    // ...

    void doStuffForColA() {
    if (anyOfSelectedRowsContains(selectedRowList,"xxx"))
    handleXXXForColA();
    else if (anyOfSelectedRowsContains(selectedRowList,"yyy"))
    handleYYYForColA();
    else if [4 more conditions and special case handlers]
    }

    void doStuffForColB() {
    if (complexBooleanConditionOf13Terms(selectedRowList))
    handleCond1ForColB();
    else if (differentComplexBooleanCondition(selectedRowList))
    handleCond2ForColB();
    else if [3 more conditions and special case handlers]
    }

    // etc



  • @snoofle said:

    new JButton("Do Stuff");
     

    The label was actually Do Stuff? I can't imagine what it woul dbe labeled otherwise.

     

    Well, I can, but it wouldn't be productive use of my time, see.



  •  I, I think I just had a siezure.  Can I get the name of the author for medical billing purposes?



  •  I think this is excellent.  I'm sick of intefaces clogged with toolbar buttons, and context menus, and ribbons.  The computer should understand what I'm trying to accomplish, right?  So the logical end game begins with a computer that understands so well that it doesn't need but a single button, and it'll work out what exactly I want to do.  This is progress, people; embrace it or fall behind.



  • Clearly, they're working around the Java bug where having more than one button causes a black hole to form.



  • Truth be told, a context-sensitive interaction unit is not a bad thing in and of itself.

    But this example is probably well and truly fucked.



  • @dhromed said:

    @snoofle said:
    new JButton("Do Stuff");
    The label was actually Do Stuff? I can't imagine what it woul dbe labeled otherwise.

     

    Well, I can, but it wouldn't be productive use of my time, see.

    Somewhere, a Canadian is crying.



  • @dhromed said:

    @snoofle said:

    new JButton("Do Stuff");
     

    The label was actually Do Stuff? I can't imagine what it woul dbe labeled otherwise.

     

    Well, I can, but it wouldn't be productive use of my time, see.

    It's not actually called "Do Stuff", but it is equally vague.

    The author told me that the reason he did it is because he "didn't want to put a lot of buttons on the UI because the user would be intimidated". These users are the ones that think that everything can be done in an excel macro, so they're used to MS ribbons and menus and button-filled displays.



  • @snoofle said:

    It's not actually called "Do Stuff", but it is equally vague.
    Do All The Work



  • @belgariontheking said:

    Somewhere, a Canadian is crying.
     

    I don't understand your inside joke because I am outside of it.



  • @dhromed said:

    @belgariontheking said:

    Somewhere, a Canadian is crying.
     

    I don't understand your inside joke because I am outside of it.

    There's always a Canadian crying somewhere, because they are "sensitive" (i.e. pussies).



  • @snoofle said:

    It's not actually called "Do Stuff", but it is equally vague.
    I vote for "Engage."

    Just thinking about the utterance of that word makes me all hard.



  • Vaguely reminds me of a project here, where the specs specified a "Save" button and a "Submit" button be present on the form.  The details of the "Save" buttton's actions were well documented, but the "Submit" button had no documented actions.  So, my first round of UAT had no Submit button, because no one could explain to me the difference between the Save button's prescribed actions and any reasonable actions for a "Submit" button.  So it failed UAT for the abscense of a button that had no purpose whatsoever, and no planned purpose.

    So I made the "Submit" button play a .wav file "Kneel Before Zod!".  UAT passed.



  • @Medezark said:

    Vaguely reminds me of a project here, where the specs specified a "Save" button and a "Submit" button be present on the form.  The details of the "Save" buttton's actions were well documented, but the "Submit" button had no documented actions.  So, my first round of UAT had no Submit button, because no one could explain to me the difference between the Save button's prescribed actions and any reasonable actions for a "Submit" button.  So it failed UAT for the abscense of a button that had no purpose whatsoever, and no planned purpose.

    So I made the "Submit" button play a .wav file "Kneel Before Zod!".  UAT passed.
    +1

    +2 if you can sneak in a change to make it Tom Goodman's classic "This is what happens when you fuck a stranger in the ass."



  • @belgariontheking said:

    Tom Goodman's

    Which one?



  • @morbiuswilters said:

    @belgariontheking said:

    Tom Goodman's

    Which one?

    I saw "Goodman" and "fuck a stranger in the ass" and I got really excited that someone here might have that bootleg John Goodman sex tape.  Imagine my disappointment.



  • @bstorer said:

    @morbiuswilters said:

    @belgariontheking said:

    Tom Goodman's

    Which one?

    I saw "Goodman" and "fuck a stranger in the ass" and I got really excited that someone here might have that bootleg John Goodman sex tape.  Imagine my disappointment.

    It's a reference to one of the best movies of all time.


  • Discourse touched me in a no-no place

    @bstorer said:

    I saw "Goodman" and "fuck a stranger in the ass" and I got really excited that someone here might have that bootleg John Goodman sex tape. Imagine my disappointment.
    Is that the one where he has the first date with Roseanne, and has to use flour to find the damp patch?



  • @morbiuswilters said:

    @bstorer said:

    @morbiuswilters said:

    @belgariontheking said:

    Tom Goodman's

    Which one?

    I saw "Goodman" and "fuck a stranger in the ass" and I got really excited that someone here might have that bootleg John Goodman sex tape.  Imagine my disappointment.

    It's a reference to one of the best movies of all time.

    Yeah, well, you know, that's just, like, your opinion, man.



  • @PJH said:

    @bstorer said:
    I saw "Goodman" and "fuck a stranger in the ass" and I got really excited that someone here might have that bootleg John Goodman sex tape. Imagine my disappointment.
    Is that the one where he has the first date with Roseanne, and has to use flour to find the damp patch?
    Well, there goes my ability to keep down food.


  • Discourse touched me in a no-no place

    @bstorer said:

    @PJH said:
    @bstorer said:
    I saw "Goodman" and "fuck a stranger in the ass" and I got really excited that someone here might have that bootleg John Goodman sex tape. Imagine my disappointment.
    Is that the one where he has the first date with Roseanne, and has to use flour to find the damp patch?
    Well, there goes my ability to keep down food.
    <bows> I thank you. I'll be here all evening....



  • @belgariontheking said:

    +2 if you can sneak in a change to make it Tom Goodman's classic "This is what happens when you fuck a stranger in the ass."

    I've always been partial to: "It's like a koala bear crapped a rainbow in my brain!"



  • @blakeyrat said:

    @belgariontheking said:
    +2 if you can sneak in a change to make it Tom Goodman's classic "This is what happens when you fuck a stranger in the ass."
    I've always been partial to: "It's like a koala bear crapped a rainbow in my brain!"

     

    We have another development round comming up, and still no one knows waht the submit button is supposed to do, nor do they want to remove it. So i do have a window of opportuinity to replace the sound file.........






  • <source src="http://matrix.senecac.on.ca/~dhhodgin/dps911/examples/seneca/video/video1.ogg" type="video/ogg">
    Edit: Damnit, I will make my troll work as intended!!


  • @snoofle said:

    Depending..., it can do any of 22 different actions

    Kind of like any given key with vi?



  • @PeriSoft said:

    @snoofle said:
    Depending..., it can do any of 22 different actions

    Kind of like any given key with vi?

     

    You made five typos in "emacs".

    The button is awesome, though: most users that I'm meeting want just that. "So I press this button and it does that, but on alternate fridays it knows to do something different, and when the moon is full on the first business day of the month it reverses the action."



  • @Medezark said:

    We have another development round comming up, and still no one knows waht the submit button is supposed to do, nor do they want to remove it. So i do have a window of opportuinity to replace the sound file.........

    You will know when you got it right. The development rounds will stop.



  • @DocBrown said:

    @PeriSoft said:

    @snoofle said:
    Depending..., it can do any of 22 different actions

    Kind of like any given key with vi?

     

    You made five typos in "emacs".

    Are you retarded?  Emacs is the exact opposite.  It requires you to hit 22 different buttons to achieve one action.



  • @bstorer said:

    It requires you to hit 22 different buttons to achieve one action.
     

    I thought it was like, you are required to configure the keystrokes, commands and macros yourself before it can do things, like, typing, and pressing backspace.



  •  @bstorer said:

    @DocBrown said:

    @PeriSoft said:

    @snoofle said:
    Depending..., it can do any of 22 different actions

    Kind of like any given key with vi?

     

    You made five typos in "emacs".

    Are you retarded?  Emacs is the exact opposite.  It requires you to hit 22 different buttons to achieve one action.

    I disregarded the modifiers. Besides, since every emacs user has a custom NN-Mb config file just to be able to type letters (what dhromed said above), you have no way of knowing which of 100500 actions you've just initiated. Pressing space bar might be launching mini-nukes at the user in this particular config for all you know.

    Seriously, I saw people arguing at length that it was better to redefine the new line/line feed from Enter to Shift+Enter, since Enter key was better used for some other (vital to an average emacs-er) activity.



  • @DocBrown said:

    custom NN-Mb config file
    I have no idea what an "NN-Mb config file" is, and neither does Google because "emacs NN-Mb" returns this thread as the first result.  But you don't have to configure a damn thing; it'll behave fine by default.  Claiming a single button can do a hundred thousand different things because it's customizable is not at all similar to what this thread is about.  Now, having a certain key sequence do different things based upon what major mode you're in is almost the same thing, but still not really.  Look, I'm not an emacs apologist by any means.  I prefer it over vim,
    but I prefer any decent IDE over both.   There are lots of things to
    criticize emacs for, but this really ain't one of them.@DocBrown said:
    Seriously, I saw people arguing at length that it was better to redefine the new line/line feed from Enter to Shift+Enter, since Enter key was better used for some other (vital to an average emacs-er) activity.
    Those people are stupid, which is not an emacs-specific trait.  My emacs config file is pretty minimal: it adds some additional modes, sets up some configuration options to my preferences, and a few shortcut sequences for commands I use frequently.  But Enter puts in a new line, just like any sane system.



  • @bstorer said:

    Look, I'm not an emacs apologist by any means.

    Ah, that explains why you wrote several paragraphs defending it.



  • @blakeyrat said:

    @bstorer said:
    Look, I'm not an emacs apologist by any means.

    Ah, that explains why you wrote several paragraphs defending it.

    I don't think anything I wrote can be classified as defending it.  I disputed factually inaccurate information.  You have to configure it to let you type letters?  C'mon, that's just fucking retarded.



  • If guess that the Enter key myth came from the fact that by default CR (i.e. the Return/Enter key) is bound to newline, while LF (which, on the now-ubiqutous PC keyboards does not have a dedicated key, and has to be typed in as Ctrl-J) is newline-and-indent, and thus a LOT of emacs config files contain lines to swap these two.



  • Is there no tag "Gee, that's why I like to troll emacs users"? Introducing one right now.


    @bannedfromcoding said:

    Enter key myth

     While you are factually right, it wasn't the thing I was talking about. Essentially, the discussion was about the inoptimal location of the Ctrl key (which is used in many emacs keybindings) on modern keyboards, and one of suggestions was to remap CapsLock --> RCtrl and Enter --> LCtrl. There were people actually using the mapping, and I doubt all of them were idiots. (Prooflink exists, but in another language.)

    Now that I look at the thread, Shift+Enter guys were vimers coming to the party to derail to discuss remapping Esc. Hmm, should try that.



  • @bannedfromcoding said:

    If guess that the Enter key myth came from the fact that by default CR (i.e. the Return/Enter key) is bound to newline, while LF (which, on the now-ubiqutous PC keyboards does not have a dedicated key, and has to be typed in as Ctrl-J) is newline-and-indent, and thus a LOT of emacs config files contain lines to swap these two.
    I've never known anyone to do this, which, yes, means nothing.  But for most of my usage indentation is handled by whatever mode I'm in.  I suppose it could be of use to one of those kitchen-sinkers who use emacs for everything, but those people are diseased.  I couldn't even stand emacs for mail, let alone the vast quantity of other uses people find for it.

    Anyway, my primary point remains: while any key in emacs can be reconfigured to do anything, and you may not know what that anything is, it's not like the OP's situation.



  • @bstorer said:

    I couldn't even stand emacs for mail,
     

    wait what?

    How do you mean, 'mail'?



  • @bstorer said:

    @bannedfromcoding said:
    If guess that the Enter key myth came from the fact that by default CR (i.e. the Return/Enter key) is bound to newline, while LF (which, on the now-ubiqutous PC keyboards does not have a dedicated key, and has to be typed in as Ctrl-J) is newline-and-indent, and thus a LOT of emacs config files contain lines to swap these two.
    I've never known anyone to do this, which, yes, means nothing.  But for most of my usage indentation is handled by whatever mode I'm in.

    This film sucks. Where are the zombies?



  • @dhromed said:

    @bstorer said:

    I couldn't even stand emacs for mail,
     

    wait what?

    How do you mean, 'mail'?

    I mean it like this.  It's perfectly fine as the text editor for mutt or whatever.



  • @davedavenotdavemaybedave said:

    This film sucks. Where are the zombies?
    I think it's M-x terror-mode to enter the right major mode, and then M-x C-f C-c z to initiate the zombies.  Of course, most emacs users just redefine the Enter key to do it, but that depends on your QQ-banana config file.



  • @bstorer said:

    I don't think anything I wrote can be classified as defending it.  I disputed factually inaccurate information.  You have to configure it to let you type letters?  C'mon, that's just fucking retarded.

    Of course it was factually inaccurate:

    1) This is DailyWTF (or do you think every thread about someone's penis, someone's mom, or Fallout 3 is entirely factually accurate? Well... the Fallout 3 ones maybe.)

    2) He was exaggerating for comic effect. Laugh, stupid.

    Anyway, it's obvious he hit a nerve by making fun of EMACs. That's fine, you can just admit to it.

    (BTW: if you have Community Server and an intern, Visual Studio can indeed make coffee. Just not as directly as you'd like.)



  • @bstorer said:

    I mean it like this.  It's perfectly fine as the text editor for mutt or whatever.
     

    Oh.

     

    O_O

     

    Look, my bike just fell over again.



  • @blakeyrat said:

    ...or Fallout 3 is entirely factually accurate? Well... the Fallout 3 ones maybe.)
     

    I was like, wha? And then I read the rest of that sentence, and I was like, ahh yeah, totally likely.

     



  • @dhromed said:

    @bstorer said:

    I mean it like this.  It's perfectly fine as the text editor for mutt or whatever.
     

    Oh.

     

    O_O

     

    Look, my bike just fell over again.

    They quote RMS's opinion as if it's a good thing.

    It also contains this gem:

    @some dude who uses emacs said:

    And maybe another more modern emacs e-mail client that has built-in support for such basic things as MIME… Any suggestions?

    A "more modern" emacs email client. Yaaah...

    speaking of which, what decade was email spelled with a hyphen? That whole article was probably written in 1992.



  • Rmail sux0rz. M-x gnus, on the other hand... is even worse, but has MOAR FUNKSHONALITY!*

    *Of course, it's primarily a newsreader, and making it send mail correctly is A Bit Of Work...



  • @blakeyrat said:

    1) This is DailyWTF (or do you think every
    thread about someone's penis, someone's mom, or Fallout 3 is entirely
    factually accurate? Well... the Fallout 3 ones maybe.)
    And what happens when something is inaccurate?  The pendants come out of the woodwork.  I've never said I'm not one of them.@blakeyrat said:
    2) He was exaggerating for comic effect. Laugh, stupid.
    If it were at all indicative of emacs, I might have.  Look, I love mocking C++'s shortcomings, of which there are many.  But if someone were to mock it because you have write your own pascal.h before you can use begin and end, I'd be hard-pressed to find that a clever exaggeration.  It's a bad exaggeration, which has been my point all along.  I'm all for insulting emacs (Did you read up on that awful rmail thing I posted?  It comes with that by default.  Moar liek rfail amirite?), just make sense in doing so. @blakeyrat said:
    Anyway, it's obvious he hit a nerve by making fun of EMACs. That's fine, you can just admit to it.
    Seriously?  My reply with legitamate mockery of emacs is what started this whole line of conversation. No, he hit a nerve by making a bad comparison between emacs and the original topic of this thread.  It's tough to rile me up by mocking an overpowered text editor, but a bad analogy?  That brings forth The Rage.  And frankly, I'm not even close to ragemode yet.  Responding to this thread just beats doing the things I should be doing.



  • @blakeyrat said:

    It also contains this gem:

    @some dude who uses emacs said:

    And maybe another more modern emacs e-mail client that has built-in support for such basic things as MIME… Any suggestions?

    A "more modern" emacs email client. Yaaah...

    Well, in answer to that dude, there's VM.  Sadly, the FAQ doesn't answer the question of "WTF kind of psychopath would use this sort of thing?"

    For a more modern example, consider some of the insane things being added to Eclipse.



  • @blakeyrat said:

    or do you think every thread about someone's penis, someone's mom, or Fallout 3 is entirely factually accurate?

    My dick is so big it tore pstorer's fat mom in half like a mininuke.



  • @morbiuswilters said:

    @blakeyrat said:

    or do you think every thread about someone's penis, someone's mom, or Fallout 3 is entirely factually accurate?

    My dick is so big it tore pstorer's fat mom in half like a mininuke.

    That's factually inaccurate!  It tore her in half like an Auto Axe.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.