Under the same hbox of javafx, drag the Drop-down bar to the left button to bounce off the problem?

Source: Internet
Author: User

I have this button column now, great GODS.

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvdtaxmtuxmtqyoq==/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast ">


Then there will be a drop-down bar on the right side of the Data. :


But now it's pulling the right pull bar. The button on the left will bounce off and On.


Then the reason for this is that a UpdateItem () method is called every time a pull-down bar is Pulled. How about letting this Drop-down bar drag


the UpdateItem () method is only recalled Once. ? Or is there any other way to improve such a bug? Urgent request!!

!。。!!


Some of the code is as Follows:

public class allroomoperatebuttontablecell<s, t> extends tablecell<s, t> {


Private Final HBox mhbox;
Private Final Button mviewbn;
Private Final Button mviewpicbn;
Private Observablevalue<t> ov;
Private Final observablelist<roomoperaterecordinfo> mtranslist;
Private Roomoperaterecordinfo mtransinfo;
Private Final TableView mtableview;


Public Allroomoperatebuttontablecell (observablelist<roomoperaterecordinfo> Translist,tableview TableView) {
This.mtranslist = translist;
This.mtransinfo = null;
This.mtableview = tableView;
This.mhbox = new HBox ();
This.mHbox.setSpacing (5);
This.mHbox.setAlignment (pos.center);

this.mviewbn = buttonbuilder.create ()
. Text ("view")
. Prefwidth (60)
. Prefheight (30)
. Build ();
This.mViewBn.setOnAction (new eventhandler<actionevent> () {
@Override
public void handle (actionevent Event) {
Synchronized (mtranslist) {
Mtableview.getselectionmodel (). Select (getindex ());
Mtransinfo = Mtranslist.get (getindex ());
If (mtransinfo.getstatus () = = Check_trans_done + Ten | | mtransinfo.getstatus () = = check_trans_cancelled + | | mTransInfo. GetStatus () = = check_trans_systemcancelled + 10) {
Checkingroomtransinfo checkinfo = new Checkingroomtransinfo (mtransinfo.gettransid (), mtransinfo.getsubmittime (), Mtransinfo.getroomno (), Mtransinfo.getcreatedbyeno (), mtransinfo.getreadflag (), mtransinfo.getstatus (), Mtransinfo.getprocesstime (), mtransinfo.getcomments (), Mtransinfo.getprocesseno ());
For (int i=0;i<mtransinfo.getmminibarinfoslist (). size (); I++) {
Checkinfo.addmminibarinfoslist (mtransinfo.getmminibarinfoslist (). Get (i));
}
Showchecktransdetail (checkinfo, null);
}else if (mtransinfo.getstatus () = = clean_trans_unhandled | | mtransinfo.getstatus () = = Clean_trans_uninspected | | Mtransinfo.getstatus () = = Clean_trans_inspected | | Mtransinfo.getstatus () = = Clean_trans_unpassed | | Mtransinfo.getstatus () = = Clean_trans_delayed | | Mtransinfo.getstatus () = = Clean_trans_cancelled | | Mtransinfo.getstatus () = = Clean_trans_timeout) {
Cleantransinfo cleaninfo = new Cleantransinfo (mtransinfo.gettransid (), mtransinfo.getsubmittime (), Mtransinfo.getroomno (), Mtransinfo.getcreatedbyeno (), mtransinfo.getreadflag (), mtransinfo.getstatus (), 2, Mtransinfo.getprocesstime (), mtransinfo.getcomments (), Mtransinfo.getprocesseno ());
Showcleantransdetail (cleaninfo, null);
}


Mtableview.requestfocus ();
}
}
});

THIS.MVIEWPICBN = Buttonbuilder.create ()
. Text ("see Figure")
. Prefwidth (60)
. Prefheight (30)
. Build ();
This.mViewPicBn.setOnAction (new eventhandler<actionevent> () {
@Override
public void handle (actionevent Event) {
Mtableview.getselectionmodel (). Select (getindex ());
Mtransinfo = Mtranslist.get (getindex ());
Showrelatedpicdetail (null,mtransinfo);
Mtableview.requestfocus ();
}
});


Mhbox.getchildren (). AddAll (mviewbn);
Setalignment (pos.center);
Setgraphic (mhbox);
}

@Override
public void UpdateItem (T item, boolean Empty) {

Super.updateitem (item, empty);
If (empty) {
SetText (null);
Setgraphic (null);
} else {
Setgraphic (mhbox);

ov = gettablecolumn (). getcellobservablevalue (getindex ());

If (ov instanceof Integerproperty) {
int status = ((integerproperty) ov). get ();
if (status = = Check_trans_done + Ten | | | status = check_trans_cancelled + | | status = = check_trans_systemcancelled + 10
|| Status = = Clean_trans_inspected | | Status = = Clean_trans_cancelled | | Status = = Clean_trans_timeout) {
Mviewbn.settext ("view");
Mviewbn.setstyle ("-fx-base:olivedrab;");
}else if (status = = Check_status_checkout | | status = = check_trans_unhandled + | | status = = check_trans_done + 100 | | Status = = check_trans_cancelled + 100
|| Status = = check_trans_systemcancelled + 100 | | Status = = Clean_status_create | | Status = =-clean_trans_uninspected | | Status = =-clean_trans_inspected
|| Status ==-clean_trans_unpassed | |  Status ==-clean_trans_delayed | | Status = =-clean_trans_cancelled | | Status = =-clean_trans_timeout | | Status = = Notify_log) {
Setgraphic (null);
Return
} else {
Mviewbn.settext ("processing");
Mviewbn.setstyle ("-fx-base:orange;");
}
}


if (mtransinfo = = Null) {
Mtransinfo = Mtranslist.get (getindex ());
If (mtransinfo.ischecking () = null && mtransinfo.ischecking ()! = "" && mtransinfo.getrelatedpiclist (). Size () > 0) {
Mhbox.getchildren (). Add (0,mviewpicbn);
}
}
}
}
}

Under the same hbox of javafx, drag the Drop-down bar to the left button to bounce off the problem?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.