Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package de.ipk_gatersleben.bit.bi.edal.publication.listener;
  
  import java.awt.Component;
  import java.awt.Point;
 
 
 
 public class NonFreeTextPanelMouseAdapter extends MouseAdapter {
 
 	public enum PanelType {
 		AUTHOR_PANEL, PUBLISHER_PANEL, LANGUAGE_PANEL, SUBJECT_PANEL, UPLOAD_PANEL, EMBARGO_PANEL;
 	}
 
 	private PanelType panelType;
 	private int rowNumber = 0;
 
 	public NonFreeTextPanelMouseAdapter(PanelType panelTypeint rowNumber) {
 		this. = panelType;
 		this. = rowNumber;
 	}
 
 	public void mousePressed(MouseEvent e) {
 		this.mouseClicked(e);
 	}
 
 	public void mouseClicked(MouseEvent mouseEvent) {
 
 		switch (this.) {
 
 		case :
 			PublicationMainPanel.blockForAuthorsField();
 			PublicationMainPanel.getMainPanel().remove(this.);
 			PublicationMainPanel.getMainPanel().add(
 			break;
 
 			PublicationMainPanel.blockForPublisherField();
 			PublicationMainPanel.getMainPanel().remove(this.);
 			PublicationMainPanel.getMainPanel().add(
 			break;
 
 			PublicationMainPanel.blockForLanguageField();
 			PublicationMainPanel.getMainPanel().remove(this.);
 			PublicationMainPanel.getMainPanel().add(
 			break;
 
 		case :
 			PublicationMainPanel.blockForSubjectsField();
 			PublicationMainPanel.getMainPanel().remove(this.);
 			PublicationMainPanel.getMainPanel().add(
 			break;
 
 		case :
 
 			AttributeTextArea focusedField = (AttributeTextAreamouseEvent
 
 			String dir = "";
 			final Component parent = PublicationModul.getFrame();
 			final JFileChooser chooser = new JFileChooser(dir);
 
 			if (chooser.showOpenDialog(parent) == .) {
 				dir = chooser.getSelectedFile().getAbsolutePath();
 				if (dir != null) {
 					if (Files.exists(chooser.getSelectedFile().toPath(),
 						focusedField.setText(dir);
 						focusedField.setToolTipText(dir);
 					}
 				}
 			}
 
 			break;
 		case :
//			try {
//				DateTimePicker.DateChooser dateChooser = (DateChooser) DateTimePicker.DateChooser.class.getConstructors()[0].newInstance();
//				
//			} catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | SecurityException e) {
//				// TODO Auto-generated catch block
//				e.printStackTrace();
//			}
//			
				DateTimePicker picker = new DateTimePicker(null);
				DateTimePicker.DateChooser chooser2 = picker.new DateChooser();
				Point p = chooser2.getLocationOnScreen();
				chooser2.showDateChooser(p);
			break;
		default:
			break;
		}
		PublicationFrame.updateUI();
	}
New to GrepCode? Check out our FAQ X