Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Copyright 2011 JBoss Inc
  * 
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  * use this file except in compliance with the License. You may obtain a copy of
  * the License at
  * 
  * http://www.apache.org/licenses/LICENSE-2.0
  * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package org.drools.workbench.screens.guided.dtable.client.widget;
A Drag Handler for Patterns in the Configuration section of the Guided Decision Table screen that acts as a Mediator between drag operations and the Decision Table Widget
public class PatternDragHandler
        implements
        DragHandler {
    //Index of pattern at the start of a drag operation
    private int startIndex = -1;
    //Index of pattern at the end of a drag operation
    private int endIndex = -1;
    private VerticalPanel patternsPanel;
    private AbstractDecisionTableWidget dtableWidget;

    
Constructor to mediate drag operations between the Pattern configuration section of the Guided Decision Table screen and the Decision Table Widget

Parameters:
patternsPanel
dtableModel
dtableWidget
    public PatternDragHandlerVerticalPanel patternsPanel,
                               GuidedDecisionTable52 dtableModel,
                               AbstractDecisionTableWidget dtableWidget ) {
        this. = patternsPanel;
        this. = dtableModel;
        this. = dtableWidget;
    }
    public void onDragStartDragStartEvent event ) {
    }
    public void onDragEndDragEndEvent event ) {
         = .getWidgetIndexevent.getContext(). );
        if (  ==  ) {
            return;
        }
        CompositeColumn<?> column = .getConditions().get );
        .movePatterncolumn,
                                   );
    }
    public void onPreviewDragEndDragEndEvent event ) throws VetoDragException {
        //Do nothing
    }
    public void onPreviewDragStartDragStartEvent event ) throws VetoDragException {
        //Do nothing
    }
New to GrepCode? Check out our FAQ X