public void tableChanged(TableModelEvent e) { if (e.getColumn() != 1) { return; } TableModel listModel = uiProperties.WAR_CONTENT_ADDITIONAL_MODEL; ClassPathSupport.Item cpItem = (ClassPathSupport.Item) listModel.getValueAt(e.getFirstRow(), 0); String newPathInWar = (String) listModel.getValueAt(e.getFirstRow(), 1); String message = null; if (cpItem.getType() == ClassPathSupport.Item.TYPE_JAR && newPathInWar.startsWith("WEB-INF")) { //NOI18N if (newPathInWar.equals("WEB-INF\\lib") || newPathInWar.equals("WEB-INF/lib")) { //NOI18N if (cpItem.getResolvedFile().isDirectory()) { message = NbBundle.getMessage(CustomizerWar.class, "MSG_NO_FOLDER_IN_WEBINF_LIB", newPathInWar); // NOI18N } else { message = NbBundle.getMessage(CustomizerWar.class, "MSG_NO_FILE_IN_WEBINF_LIB", newPathInWar); // NOI18N } } else if (newPathInWar.equals("WEB-INF\\classes") || newPathInWar.equals("WEB-INF/classes")) { //NOI18N message = NbBundle.getMessage(CustomizerWar.class, "MSG_NO_FOLDER_IN_WEBINF_CLASSES", newPathInWar); // NOI18N } } if (message != null) { DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message (message, NotifyDescriptor.WARNING_MESSAGE)); } } }
path = artifactItem.getDescription().getPathInDeployment(); if (path != null) { File file = item.getResolvedFile(); if (file != null) { files.add(file);
public void setValueAt(Object value, int row, int column) { if (column != 1 || !(value instanceof Boolean)) { return; } if (Boolean.TRUE.equals(value)) { ClassPathSupport.Item item = getItem(row); String pathInWar = (item.getType() == ClassPathSupport.Item.TYPE_JAR && item.getResolvedFile().isDirectory()) || (item.getType() == ClassPathSupport.Item.TYPE_LIBRARY && Utils.isLibraryDirectoryBased(item)) ? ClassPathSupportCallbackImpl.PATH_IN_WAR_DIR : ClassPathSupportCallbackImpl.PATH_IN_WAR_LIB; item.setAdditionalProperty(ClassPathSupportCallbackImpl.PATH_IN_DEPLOYMENT, pathInWar); } else { getItem(row).setAdditionalProperty(ClassPathSupportCallbackImpl.PATH_IN_DEPLOYMENT, ClassPathSupportCallbackImpl.PATH_IN_WAR_NONE); } fireTableCellUpdated(row, column); }
public void initItem(ClassPathSupport.Item item) { switch (item.getType()) { case ClassPathSupport.Item.TYPE_JAR: item.setAdditionalProperty(ClassPathSupportCallbackImpl.PATH_IN_DEPLOYMENT, item.getResolvedFile().isDirectory() ? ClassPathSupportCallbackImpl.PATH_IN_WAR_DIR : ClassPathSupportCallbackImpl.PATH_IN_WAR_LIB); break; case ClassPathSupport.Item.TYPE_LIBRARY: if (item.getLibrary().getType().equals(J2eePlatform.LIBRARY_TYPE)) { break; } item.setAdditionalProperty(ClassPathSupportCallbackImpl.PATH_IN_DEPLOYMENT, Utils.isLibraryDirectoryBased(item) ? ClassPathSupportCallbackImpl.PATH_IN_WAR_DIR : ClassPathSupportCallbackImpl.PATH_IN_WAR_LIB); break; default: item.setAdditionalProperty(ClassPathSupportCallbackImpl.PATH_IN_DEPLOYMENT, ClassPathSupportCallbackImpl.PATH_IN_WAR_LIB); } } };