JBoss Tools SVN: r13990 - trunk/seam/docs/reference.
by jbosstools-commits@lists.jboss.org
Author: artdaw
Date: 2009-03-04 15:15:24 -0500 (Wed, 04 Mar 2009)
New Revision: 13990
Modified:
trunk/seam/docs/reference/pom.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-489 - three profiles were created
Modified: trunk/seam/docs/reference/pom.xml
===================================================================
--- trunk/seam/docs/reference/pom.xml 2009-03-04 20:03:00 UTC (rev 13989)
+++ trunk/seam/docs/reference/pom.xml 2009-03-04 20:15:24 UTC (rev 13990)
@@ -61,7 +61,7 @@
<version>1.0.0</version>
<type>jdocbook-style</type>
</dependency>
- <dependency>
+ <dependency>
<groupId>org.jboss</groupId>
<artifactId>jbossorg-docbook-xslt</artifactId>
<version>1.1.0</version>
17 years, 1 month
JBoss Tools SVN: r13989 - trunk/seam/docs/reference.
by jbosstools-commits@lists.jboss.org
Author: artdaw
Date: 2009-03-04 15:03:00 -0500 (Wed, 04 Mar 2009)
New Revision: 13989
Modified:
trunk/seam/docs/reference/pom.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-489 - three profiles were created
Modified: trunk/seam/docs/reference/pom.xml
===================================================================
--- trunk/seam/docs/reference/pom.xml 2009-03-04 19:54:03 UTC (rev 13988)
+++ trunk/seam/docs/reference/pom.xml 2009-03-04 20:03:00 UTC (rev 13989)
@@ -10,11 +10,33 @@
<packaging>jdocbook</packaging>
<name>Seam_Reference_Guide</name>
- <profiles>
+ <profiles>
<profile>
+ <id>release</id>
+ <properties>
+ <master>master_output.xml</master>
+ <xsl-single>classpath:/xslt/org/jboss/tools/xhtml-single-release.xsl</xsl-single>
+ <xsl-chunked>classpath:/xslt/org/jboss/tools/xhtml-release.xsl</xsl-chunked>
+ <xsl-pdf>classpath:/xslt/org/jboss/tools/pdf.xsl</xsl-pdf>
+ </properties>
+ </profile>
+ <profile>
+ <id>releaseJBDS</id>
+ <properties>
+ <master>master_output.xml</master>
+ <xsl-single>classpath:/xslt/com/jboss/tools/xhtml-single-release.xsl</xsl-single>
+ <xsl-chunked>classpath:/xslt/com/jboss/tools/xhtml-release.xsl</xsl-chunked>
+ <xsl-pdf>classpath:/xslt/com/jboss/tools/pdf.xsl</xsl-pdf>
+ <cssdir>../../../documentation/jbosstools-jdocbook-style/src/main/com/css/</cssdir>
+ </properties>
+ </profile>
+ <profile>
<id>diffmk</id>
<properties>
- <master>master_output.xml</master>
+ <master>master_output.xml</master>
+ <xsl-single>classpath:/xslt/org/jboss/tools/xhtml-single-diff.xsl</xsl-single>
+ <xsl-chunked>classpath:/xslt/org/jboss/tools/xhtml-diff.xsl</xsl-chunked>
+ <xsl-pdf>classpath:/xslt/org/jboss/tools/pdf-diff.xsl</xsl-pdf>
</properties>
</profile>
</profiles>
@@ -29,6 +51,17 @@
<extensions>true</extensions>
<dependencies>
<dependency>
+ <groupId>com.jboss</groupId>
+ <artifactId>jbossent-docbook-xslt</artifactId>
+ <version>1.0.0</version>
+ </dependency>
+ <dependency>
+ <groupId>com.jboss</groupId>
+ <artifactId>jbossent-jdocbook-style</artifactId>
+ <version>1.0.0</version>
+ <type>jdocbook-style</type>
+ </dependency>
+ <dependency>
<groupId>org.jboss</groupId>
<artifactId>jbossorg-docbook-xslt</artifactId>
<version>1.1.0</version>
@@ -39,6 +72,11 @@
<version>1.1.0</version>
<type>jdocbook-style</type>
</dependency>
+ <dependency>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>jbosstools-docbook-xslt</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </dependency>
</dependencies>
<configuration>
@@ -57,17 +95,17 @@
<formats>
<format>
<formatName>pdf</formatName>
- <stylesheetResource>file:${pom.basedir}/${stylesdir}/xslt/org/jboss/tools/pdf.xsl</stylesheetResource>
+ <stylesheetResource>${xsl-pdf}</stylesheetResource>
<finalName>${pom.name}.pdf</finalName>
</format>
<format>
<formatName>html</formatName>
- <stylesheetResource>file:${pom.basedir}/${stylesdir}/xslt/org/jboss/tools/xhtml.xsl</stylesheetResource>
+ <stylesheetResource>${xsl-chunked}</stylesheetResource>
<finalName>index.html</finalName>
</format>
<format>
<formatName>html_single</formatName>
- <stylesheetResource>file:${pom.basedir}/${stylesdir}/xslt/org/jboss/tools/xhtml-single.xsl</stylesheetResource>
+ <stylesheetResource>${xsl-single}</stylesheetResource>
<finalName>index.html</finalName>
</format>
<format>
@@ -106,6 +144,9 @@
<properties>
<stylesdir>../../../documentation/jbosstools-docbook-xslt/src/main/resources/</stylesdir>
+ <xsl-single>classpath:/xslt/org/jboss/tools/xhtml-single.xsl</xsl-single>
+ <xsl-chunked>classpath:/xslt/org/jboss/tools/xhtml.xsl</xsl-chunked>
+ <xsl-pdf>classpath:/xslt/org/jboss/tools/pdf.xsl</xsl-pdf>
<cssdir>../../../documentation/jbosstools-jdocbook-style/src/main/org/css/</cssdir>
<master>master.xml</master>
<translation>en-US</translation>
17 years, 1 month
JBoss Tools SVN: r13988 - in branches/jbosstools-3.0.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp: outline/cssdialog and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2009-03-04 14:54:03 -0500 (Wed, 04 Mar 2009)
New Revision: 13988
Added:
branches/jbosstools-3.0.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSValidator.java
Modified:
branches/jbosstools-3.0.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/JstUIMessages.java
branches/jbosstools-3.0.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/messages.properties
branches/jbosstools-3.0.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java
branches/jbosstools-3.0.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/StyleComposite.java
branches/jbosstools-3.0.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/events/StyleAttributes.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3909
Modified: branches/jbosstools-3.0.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/JstUIMessages.java
===================================================================
--- branches/jbosstools-3.0.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/JstUIMessages.java 2009-03-04 19:48:47 UTC (rev 13987)
+++ branches/jbosstools-3.0.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/JstUIMessages.java 2009-03-04 19:54:03 UTC (rev 13988)
@@ -104,4 +104,5 @@
public static String BUTTON_ADD_NEW_STYLE_CLASS;
public static String ENTER_CSS_CLASS_NAME;
public static String CSS_CLASS_NAME_NOT_VALID;
+ public static String CSS_INVALID_STYLE_PROPERTY;
}
Modified: branches/jbosstools-3.0.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/messages.properties
===================================================================
--- branches/jbosstools-3.0.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/messages.properties 2009-03-04 19:48:47 UTC (rev 13987)
+++ branches/jbosstools-3.0.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/messages.properties 2009-03-04 19:54:03 UTC (rev 13988)
@@ -8,6 +8,7 @@
CSS_STYLE_EDITOR_TITLE=CSS Style
CSS_EMPTY_FILE_PATH_MESSAGE=Choose any CSS file
CSS_EMPTY_STYLE_CLASS_MESSAGE=Style class is empty
+CSS_INVALID_STYLE_PROPERTY=Invalid Style class property has been entered.Preview Tab will be not updated.
CSS_SAVE_DIALOG_TITLE=Save CSS file
CSS_SAVE_DIALOG_MESSAGE=CSS file has been changed.\nWould you like to save changes?
Modified: branches/jbosstools-3.0.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java
===================================================================
--- branches/jbosstools-3.0.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java 2009-03-04 19:48:47 UTC (rev 13987)
+++ branches/jbosstools-3.0.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java 2009-03-04 19:54:03 UTC (rev 13988)
@@ -50,6 +50,7 @@
import org.jboss.tools.common.model.ui.widgets.Split;
import org.jboss.tools.jst.jsp.messages.JstUIMessages;
import org.jboss.tools.jst.jsp.outline.cssdialog.common.CSSModel;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.CSSValidator;
import org.jboss.tools.jst.jsp.outline.cssdialog.common.Constants;
import org.jboss.tools.jst.jsp.outline.cssdialog.common.Util;
import org.jboss.tools.jst.jsp.outline.cssdialog.events.ChangeStyleEvent;
@@ -64,7 +65,7 @@
*
* @author Igor Zhukov (izhukov(a)exadel.com)
*/
-public class CSSClassDialog extends TitleAreaDialog {
+public class CSSClassDialog extends TitleAreaDialog implements ChangeStyleListener {
public static final String ID = "org.jboss.tools.jst.jsp.outline.cssdialog.CSSClassDialog"; //$NON-NLS-1$
@@ -108,19 +109,17 @@
private IStatus filePathStatus = null;
// 2. holds an error if the destination class style is empty
private IStatus classNameStatus = null;
+ // 3. holds an error if inccorrect property was specified
+ private IStatus cssValueStatus =null;
// an array of subscribed message dialog listener
private ArrayList<MessageDialogListener> errorListeners = new ArrayList<MessageDialogListener>();
// parameter indicates if dialog was opened from Wizard
private final boolean callFromWizard;
+
+ private Button addNewClass;
- // this job is used to correctly process change style class combo text with delay
-// private UIJob uiJob = null;
- // the job name
-// private String jobName = "Update CSS Composite"; //$NON-NLS-1$
-// // delay for job in milliseconds
-// private int delay = 1000;
/**
* Constructor.
@@ -138,6 +137,7 @@
classNameStatus = new Status(IStatus.ERROR, notUsed, 0, JstUIMessages.CSS_EMPTY_STYLE_CLASS_MESSAGE, null);
styleAttributes = new StyleAttributes();
+ styleAttributes.addChangeStyleListener(this);
this.callFromWizard = callFromWizard;
this.selection = selection;
init();
@@ -164,7 +164,6 @@
if (currentFile == null) {
currentFile = Util.getActiveCssFile();
}
-// currentClassStyle = Util.getActivePageCSSSelectorIfAny();
}
/**
@@ -253,7 +252,7 @@
styleChanged = true;
if (currentClassStyle != null && !currentClassStyle.equals(Constants.EMPTY)
&& currentFile != null && !currentFile.equals(Constants.EMPTY)) {
- applyButton.setEnabled(true);
+ updateApplyButton(true);
}
}
});
@@ -281,16 +280,6 @@
// add content assist to style COMBO component
SimpleContentProposalProvider proposalProvider = new SimpleContentProposalProvider(classCombo.getItems());
proposalProvider.setFiltering(true);
-// contentAssistAdapter = new ContentAssistCommandAdapter(
-// classCombo, new ComboContentAdapter(), proposalProvider, null, null, true);
-// contentAssistAdapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
-// contentAssistAdapter.addContentProposalListener(new IContentProposalListener() {
-// public void proposalAccepted(IContentProposal proposal) {
-// cssStyleClassChanged();
-// applyButton.setEnabled(false);
-// keyInputSelector = false;
-// }
-// });
split.setWeights(new int[]{15, 85});
split.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, true));
@@ -324,80 +313,6 @@
applyToStatusLine(status);
}
});
-
-// Button button = new Button(parent, SWT.PUSH);
-// button.setLayoutData(new GridData(GridData.END, GridData.CENTER, false, false));
-//
-// ImageDescriptor imageDesc = JspEditorPlugin.getImageDescriptor(Constants.IMAGE_FOLDERLARGE_FILE_LOCATION);
-// Image image = imageDesc.createImage();
-// button.setImage(image);
-// button.setToolTipText(JstUIMessages.CSS_BROWSE_BUTTON_TOOLTIP);
-// button.addDisposeListener(new DisposeListener() {
-// public void widgetDisposed(DisposeEvent e) {
-// Button button = (Button) e.getSource();
-// button.getImage().dispose();
-// }
-// });
-// button.addSelectionListener(new SelectionAdapter() {
-// public void widgetSelected(SelectionEvent event) {
-//// IResource project = Util.getCurrentProject();
-// IResource project = ResourcesPlugin.getWorkspace().getRoot();
-//
-// ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(),
-// new WorkbenchLabelProvider(), new BaseWorkbenchContentProvider());
-// dialog.addFilter(new FileExtensionFilter(fileExtensions));
-// dialog.setTitle(JstUIMessages.CSS_FILE_SELECT_DIALOG_TITLE);
-// dialog.setMessage(JstUIMessages.CSS_FILE_SELECT_DIALOG_LABEL);
-// dialog.setInput(project);
-// dialog.setAllowMultiple(false);
-// dialog.setDoubleClickSelects(false);
-// if (currentFile != null) {
-// dialog.setInitialSelection(currentFile);
-// }
-// dialog.setEmptyListMessage(JstUIMessages.CSS_FILE_SELECT_DIALOG_EMPTY_MESSAGE);
-//
-// if (dialog.open() == Window.OK) {
-// IResource res = (IResource) dialog.getFirstResult();
-// // make some important saving actions
-// if (res instanceof IFile) {
-// if (styleChanged && currentFile != null) {
-// MessageBox messageBox = new MessageBox(getParentShell(), SWT.YES | SWT.NO | SWT.ICON_QUESTION);
-// messageBox.setText(JstUIMessages.CSS_SAVE_DIALOG_TITLE);
-// messageBox.setMessage(CSSClassDialog.getMessageForSaveDialog(currentFile));
-// int result = messageBox.open();
-// if (result == SWT.YES) {
-// saveChanges(true);
-// } else {
-// updateStyleComposite();
-// }
-// }
-// styleComposite.revertPreview();
-// releaseResources();
-//
-// // open new CSS file and initialize dialog
-// boolean useRelativePath = true;
-// if (project instanceof IWorkspaceRoot) {
-// useRelativePath = false;
-// }
-// boolean updateCSSModel = false;
-// if (currentFile != null && !currentFile.equals(Constants.EMPTY)) {
-// currentClassStyle = null;
-// updateCSSModel = true;
-// }
-// currentFile = (IFile)res;
-// initCSSModel(currentFile, useRelativePath, updateCSSModel);
-// updateOKButtonState();
-// applyButton.setEnabled(false);
-// styleChanged = false;
-//
-// // update content assist proposals
-// SimpleContentProposalProvider proposalProvider =
-// (SimpleContentProposalProvider)contentAssistAdapter.getContentProposalProvider();
-// proposalProvider.setProposals(classCombo.getItems());
-// }
-// }
-// }
-// });
}
/**
@@ -415,24 +330,6 @@
classCombo = new Combo(parent, SWT.BORDER|SWT.READ_ONLY);
classCombo.setLayoutData(gridData);
- // add selection listener
-// classCombo.addSelectionListener(new SelectionAdapter() {
-// public void widgetSelected(SelectionEvent e) {
-// if (keyInputSelector) {
-// keyInputSelector = false;
-// if (currentClassStyle != null && classCombo.indexOf(currentClassStyle) != -1) {
-// return;
-// }
-// }
-// keyInputSelector = false;
-// }
-// });
- // add key modified listener
-// classCombo.addKeyListener(new KeyAdapter() {
-// public void keyReleased(KeyEvent e) {
-// keyInputSelector = true;
-// }
-// });
// this listener is responsible for processing dialog header message events
classCombo.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
@@ -452,13 +349,13 @@
return;
}
cssStyleClassChanged();
- applyButton.setEnabled(false);
+ updateApplyButton(false);
}
});
//creates a button for add new class
- Button show = new Button(parent, SWT.PUSH);
- show.setText(JstUIMessages.BUTTON_ADD_NEW_STYLE_CLASS);
- show.addSelectionListener(new SelectionAdapter() {
+ addNewClass = new Button(parent, SWT.PUSH);
+ addNewClass.setText(JstUIMessages.BUTTON_ADD_NEW_STYLE_CLASS);
+ addNewClass.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
InputDialog dlg = new InputDialog(parent.getShell(),
JstUIMessages.ENTER_CSS_CLASS_NAME, JstUIMessages.ENTER_CSS_CLASS_NAME, classCombo.getText(),
@@ -485,7 +382,7 @@
* @param styleClassName - name of new style class
*/
public void addNewStyleClass(String styleClassName) {
- applyButton.setEnabled(true);
+ updateApplyButton(true);
styleChanged = true;
currentClassStyle = styleClassName;
updateStyleComposite();
@@ -546,7 +443,7 @@
buttonComposite.setLayout(new GridLayout());
// add APPLY button
applyButton = createCustomButton(buttonComposite, JstUIMessages.BUTTON_APPLY);
- applyButton.setEnabled(false);
+ updateApplyButton(false);
applyButton.setToolTipText(JstUIMessages.CSS_APPLY_CHANGES);
applyButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
@@ -556,7 +453,7 @@
classCombo.add(currentClassStyle);
}
saveChanges(false);
- applyButton.setEnabled(false);
+ updateApplyButton(false);
styleChanged = false;
}
}
@@ -569,7 +466,7 @@
styleComposite.clearStyleComposite(currentClassStyle);
styleComposite.updatePreview(currentClassStyle);
styleComposite.updateStyle();
- applyButton.setEnabled(true);
+ updateApplyButton(true);
styleChanged = true;
}
});
@@ -626,7 +523,7 @@
// } else {
// styleChanged = false;
// }
- applyButton.setEnabled(true);
+ updateApplyButton(true);
styleChanged = true;
updateStyleComposite();
@@ -701,7 +598,7 @@
private void updateOKButtonState() {
Button okButton = getButton(IDialogConstants.OK_ID);
if (okButton != null) {
- if (currentClassStyle == null || currentClassStyle.equals(Constants.EMPTY) || currentFile == null) {
+ if (findMostSevere()!=null&&findMostSevere().getSeverity()==IStatus.ERROR) {
okButton.setEnabled(false);
} else {
okButton.setEnabled(true);
@@ -890,10 +787,15 @@
if (classNameStatus.matches(IStatus.ERROR)) {
return classNameStatus;
}
- if (filePathStatus.getSeverity() > classNameStatus.getSeverity()) {
- return filePathStatus;
+ if(cssValueStatus!=null && cssValueStatus.matches(IStatus.ERROR)){
+ return cssValueStatus;
}
- else return classNameStatus;
+ if(cssValueStatus!=null && cssValueStatus.matches(IStatus.ERROR)){
+ return cssValueStatus;
+ } else {
+ return classNameStatus;
+ }
+
}
/**
@@ -934,4 +836,43 @@
public void setCurrentFile(IFile currentFile) {
this.currentFile = currentFile;
}
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.jsp.outline.cssdialog.events.ChangeStyleListener#styleChanged(org.jboss.tools.jst.jsp.outline.cssdialog.events.ChangeStyleEvent)
+ */
+ public void styleChanged(ChangeStyleEvent event) {
+ if (!this.styleAttributes.isValid()) {
+ cssValueStatus = new Status(IStatus.ERROR, notUsed, 0,
+ JstUIMessages.CSS_INVALID_STYLE_PROPERTY, null);
+ notifyListeners(event, cssValueStatus);
+ addNewClass.setEnabled(false);
+ } else {
+ cssValueStatus = null;
+ addNewClass.setEnabled(true);
+ notifyListeners(event, new Status(IStatus.OK, notUsed, 0,
+ JstUIMessages.CSS_STYLE_CLASS_EDITOR_DESCRIPTION, null));
+ }
+ if (cssValueStatus != null && classCombo != null) {
+ classCombo.setEnabled(false);
+ } else {
+ classCombo.setEnabled(true);
+
+ }
+ updateApplyButton(true);
+ updateOKButtonState();
+ applyToStatusLine(findMostSevere());
+ }
+ /**
+ * Update upplyButtonState
+ * @param available
+ */
+ private void updateApplyButton(boolean enabled){
+ if(cssValueStatus!=null
+ &&cssValueStatus.matches(IStatus.ERROR)) {
+ applyButton.setEnabled(false);
+ }else {
+ applyButton.setEnabled(enabled);
+ }
+
+ }
}
Modified: branches/jbosstools-3.0.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/StyleComposite.java
===================================================================
--- branches/jbosstools-3.0.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/StyleComposite.java 2009-03-04 19:48:47 UTC (rev 13987)
+++ branches/jbosstools-3.0.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/StyleComposite.java 2009-03-04 19:54:03 UTC (rev 13988)
@@ -237,6 +237,11 @@
tabBoxesControl.updateData(false);
lastSelectedTab = tabBoxes;
} else if (tabFolder.getSelection()[FIRST_SELECTION] == tabPreview) {
+ if(!styleAttributes.isValid()){
+ //mareshkau, if styles attributes not valid we cann't create
+ //correct preview
+ return;
+ }
cssModel.setCSS(styleAttributes.getCssSelector(), styleAttributes);
tabPreviewControl.selectEditorArea(styleAttributes.getCssSelector(), 0);
lastSelectedTab = tabPreview;
Copied: branches/jbosstools-3.0.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSValidator.java (from rev 13982, trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSValidator.java)
===================================================================
--- branches/jbosstools-3.0.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSValidator.java (rev 0)
+++ branches/jbosstools-3.0.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSValidator.java 2009-03-04 19:54:03 UTC (rev 13988)
@@ -0,0 +1,135 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.jsp.outline.cssdialog.common;
+
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+
+import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.jboss.tools.jst.jsp.JspEditorPlugin;
+import org.w3c.dom.css.CSSStyleDeclaration;
+import org.w3c.dom.css.CSSStyleRule;
+import org.w3c.dom.css.CSSStyleSheet;
+
+/**
+ * CSS Validator
+ *
+ * @author yradtsevich
+ *
+ */
+public class CSSValidator {
+ // FIXME: this hard-coded string have to be replaced by reference
+ private static final String CSS_CONTENT_TYPE_IDENTIFIER = "org.eclipse.wst.css.core.csssource"; //$NON-NLS-1$
+ private final CSSStyleSheet validatingCSS;
+ private final LogHacker logHacker = new LogHacker();
+
+ @SuppressWarnings("restriction")
+ public CSSValidator() {
+ IModelManager modelManager = StructuredModelManager.getModelManager();
+ ICSSModel validatingModel = (ICSSModel) modelManager.createUnManagedStructuredModelFor(CSS_CONTENT_TYPE_IDENTIFIER);
+
+ validatingCSS = (CSSStyleSheet) validatingModel.getDocument();
+ }
+
+ private void cleanValidatingCSS() {
+ int ruleNumber;
+
+ while ((ruleNumber = validatingCSS.getCssRules().getLength()) > 0) {
+ validatingCSS.deleteRule(ruleNumber - 1);
+ }
+ }
+
+ /**
+ * Validates value of a CSS attribute.
+ *
+ * @param value the
+ * @return {@code true} if the attribute is valid, {@code false} otherwise
+ */
+ public boolean isValidValue(String value) {
+ logHacker.disableLogging();
+ boolean valid = true;
+ try {
+ validatingCSS.insertRule(".testSelector {}", 0); //$NON-NLS-1$
+ CSSStyleRule cssRule = ((CSSStyleRule) validatingCSS.getCssRules().item(0));
+ CSSStyleDeclaration declaration = cssRule.getStyle();
+ declaration.setProperty("background", value, Constants.EMPTY); //$NON-NLS-1$
+ } catch (Throwable e) {
+ valid = false;
+ } finally {
+ logHacker.enableLogging();
+ cleanValidatingCSS();
+ }
+
+ return valid;
+ }
+
+ /**
+ * Validates CSS selector value.
+ *
+ * @param selector the selector value
+ * @return {@code true} if the selector is valid, {@code false} otherwise
+ */
+ public boolean isValidSelector(String selector) {
+ boolean valid = true;
+ try {
+ validatingCSS.insertRule(selector + " {}", 0); //$NON-NLS-1$
+ } catch (Throwable e) {
+ valid = false;
+ } finally {
+ cleanValidatingCSS();
+ }
+
+ return valid;
+ }
+
+ /**
+ * Gives opportunity to delete all loggers from {@link org.eclipse.core.internal.runtime.RuntimeLog}
+ *
+ * @author yradtsevich
+ *
+ */
+ private class LogHacker {
+ private Field logListeners = null;
+ private Object oldValue = null;
+
+ public LogHacker() {
+ try {
+ logListeners = org.eclipse.core.internal.runtime.RuntimeLog.class.getDeclaredField("logListeners");
+ logListeners.setAccessible(true);
+ } catch (Throwable e) {
+ JspEditorPlugin.getPluginLog().logError(e);
+ }
+ }
+
+ public void disableLogging() {
+ try {
+ oldValue = logListeners.get(null);
+ logListeners.set(null, new ArrayList(0));
+ } catch (Throwable e) {
+ JspEditorPlugin.getPluginLog().logError(e);
+ }
+ }
+
+ public void enableLogging() {
+ try {
+ if (oldValue != null) {
+ logListeners.set(null, oldValue);
+ }
+ } catch (Throwable e) {
+ JspEditorPlugin.getPluginLog().logError(e);
+ } finally {
+ oldValue = null;
+ }
+ }
+ }
+}
Modified: branches/jbosstools-3.0.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/events/StyleAttributes.java
===================================================================
--- branches/jbosstools-3.0.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/events/StyleAttributes.java 2009-03-04 19:48:47 UTC (rev 13987)
+++ branches/jbosstools-3.0.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/events/StyleAttributes.java 2009-03-04 19:54:03 UTC (rev 13988)
@@ -16,6 +16,7 @@
import java.util.Set;
import java.util.Map.Entry;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.CSSValidator;
import org.jboss.tools.jst.jsp.outline.cssdialog.common.Constants;
/**
@@ -26,12 +27,13 @@
private String cssSelector = null;
private HashMap<String, String> attributeMap = null;
private ArrayList<ChangeStyleListener> listeners = new ArrayList<ChangeStyleListener>();
-
+ private CSSValidator cssValidator;
/**
* Default constructor.
*/
public StyleAttributes() {
this.attributeMap = new HashMap<String, String>();
+ cssValidator = new CSSValidator();
}
/**
@@ -158,7 +160,7 @@
public String getCssSelector() {
return cssSelector;
}
-
+
/**
* String representation of style attributes.
*
@@ -173,4 +175,16 @@
}
return buf.toString();
}
+ /**
+ * Checks if attributes that has been entered to style valid
+ * @return
+ */
+ public boolean isValid() {
+ for(String value : getAttributeMap().values()) {
+ if(!cssValidator.isValidValue(value)) {
+ return false;
+ }
+ }
+ return true;
+ }
}
17 years, 1 month
JBoss Tools SVN: r13987 - in trunk/jsf/docs: jsf_tools_tutorial and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: artdaw
Date: 2009-03-04 14:48:47 -0500 (Wed, 04 Mar 2009)
New Revision: 13987
Modified:
trunk/jsf/docs/jsf_tools_ref_guide/pom.xml
trunk/jsf/docs/jsf_tools_tutorial/pom.xml
trunk/jsf/docs/userguide/pom.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-489 - three profiles were created
Modified: trunk/jsf/docs/jsf_tools_ref_guide/pom.xml
===================================================================
--- trunk/jsf/docs/jsf_tools_ref_guide/pom.xml 2009-03-04 19:45:47 UTC (rev 13986)
+++ trunk/jsf/docs/jsf_tools_ref_guide/pom.xml 2009-03-04 19:48:47 UTC (rev 13987)
@@ -12,9 +12,31 @@
<profiles>
<profile>
+ <id>release</id>
+ <properties>
+ <master>master_output.xml</master>
+ <xsl-single>classpath:/xslt/org/jboss/tools/xhtml-single-release.xsl</xsl-single>
+ <xsl-chunked>classpath:/xslt/org/jboss/tools/xhtml-release.xsl</xsl-chunked>
+ <xsl-pdf>classpath:/xslt/org/jboss/tools/pdf.xsl</xsl-pdf>
+ </properties>
+ </profile>
+ <profile>
+ <id>releaseJBDS</id>
+ <properties>
+ <master>master_output.xml</master>
+ <xsl-single>classpath:/xslt/com/jboss/tools/xhtml-single-release.xsl</xsl-single>
+ <xsl-chunked>classpath:/xslt/com/jboss/tools/xhtml-release.xsl</xsl-chunked>
+ <xsl-pdf>classpath:/xslt/com/jboss/tools/pdf.xsl</xsl-pdf>
+ <cssdir>../../../documentation/jbosstools-jdocbook-style/src/main/com/css/</cssdir>
+ </properties>
+ </profile>
+ <profile>
<id>diffmk</id>
<properties>
- <master>master_output.xml</master>
+ <master>master_output.xml</master>
+ <xsl-single>classpath:/xslt/org/jboss/tools/xhtml-single-diff.xsl</xsl-single>
+ <xsl-chunked>classpath:/xslt/org/jboss/tools/xhtml-diff.xsl</xsl-chunked>
+ <xsl-pdf>classpath:/xslt/org/jboss/tools/pdf-diff.xsl</xsl-pdf>
</properties>
</profile>
</profiles>
@@ -28,7 +50,18 @@
<extensions>true</extensions>
<dependencies>
+ <dependency>
+ <groupId>com.jboss</groupId>
+ <artifactId>jbossent-docbook-xslt</artifactId>
+ <version>1.0.0</version>
+ </dependency>
<dependency>
+ <groupId>com.jboss</groupId>
+ <artifactId>jbossent-jdocbook-style</artifactId>
+ <version>1.0.0</version>
+ <type>jdocbook-style</type>
+ </dependency>
+ <dependency>
<groupId>org.jboss</groupId>
<artifactId>jbossorg-docbook-xslt</artifactId>
<version>1.1.0</version>
@@ -39,6 +72,11 @@
<version>1.1.0</version>
<type>jdocbook-style</type>
</dependency>
+ <dependency>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>jbosstools-docbook-xslt</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </dependency>
</dependencies>
<configuration>
@@ -57,17 +95,17 @@
<formats>
<format>
<formatName>pdf</formatName>
- <stylesheetResource>file:${pom.basedir}/${stylesdir}/xslt/org/jboss/tools/pdf.xsl</stylesheetResource>
+ <stylesheetResource>${xsl-pdf}</stylesheetResource>
<finalName>${pom.name}.pdf</finalName>
</format>
<format>
<formatName>html</formatName>
- <stylesheetResource>file:${pom.basedir}/${stylesdir}/xslt/org/jboss/tools/xhtml.xsl</stylesheetResource>
+ <stylesheetResource>${xsl-chunked}</stylesheetResource>
<finalName>index.html</finalName>
</format>
<format>
<formatName>html_single</formatName>
- <stylesheetResource>file:${pom.basedir}/${stylesdir}/xslt/org/jboss/tools/xhtml-single.xsl</stylesheetResource>
+ <stylesheetResource>${xsl-single}</stylesheetResource>
<finalName>index.html</finalName>
</format>
<format>
@@ -106,6 +144,9 @@
<properties>
<stylesdir>../../../documentation/jbosstools-docbook-xslt/src/main/resources/</stylesdir>
+ <xsl-single>classpath:/xslt/org/jboss/tools/xhtml-single.xsl</xsl-single>
+ <xsl-chunked>classpath:/xslt/org/jboss/tools/xhtml.xsl</xsl-chunked>
+ <xsl-pdf>classpath:/xslt/org/jboss/tools/pdf.xsl</xsl-pdf>
<cssdir>../../../documentation/jbosstools-jdocbook-style/src/main/org/css/</cssdir>
<master>master.xml</master>
<translation>en-US</translation>
Modified: trunk/jsf/docs/jsf_tools_tutorial/pom.xml
===================================================================
--- trunk/jsf/docs/jsf_tools_tutorial/pom.xml 2009-03-04 19:45:47 UTC (rev 13986)
+++ trunk/jsf/docs/jsf_tools_tutorial/pom.xml 2009-03-04 19:48:47 UTC (rev 13987)
@@ -10,11 +10,33 @@
<packaging>jdocbook</packaging>
<name>JSF_Tools_Tutorial</name>
- <profiles>
+ <profiles>
<profile>
+ <id>release</id>
+ <properties>
+ <master>master_output.xml</master>
+ <xsl-single>classpath:/xslt/org/jboss/tools/xhtml-single-release.xsl</xsl-single>
+ <xsl-chunked>classpath:/xslt/org/jboss/tools/xhtml-release.xsl</xsl-chunked>
+ <xsl-pdf>classpath:/xslt/org/jboss/tools/pdf.xsl</xsl-pdf>
+ </properties>
+ </profile>
+ <profile>
+ <id>releaseJBDS</id>
+ <properties>
+ <master>master_output.xml</master>
+ <xsl-single>classpath:/xslt/com/jboss/tools/xhtml-single-release.xsl</xsl-single>
+ <xsl-chunked>classpath:/xslt/com/jboss/tools/xhtml-release.xsl</xsl-chunked>
+ <xsl-pdf>classpath:/xslt/com/jboss/tools/pdf.xsl</xsl-pdf>
+ <cssdir>../../../documentation/jbosstools-jdocbook-style/src/main/com/css/</cssdir>
+ </properties>
+ </profile>
+ <profile>
<id>diffmk</id>
<properties>
- <master>master_output.xml</master>
+ <master>master_output.xml</master>
+ <xsl-single>classpath:/xslt/org/jboss/tools/xhtml-single-diff.xsl</xsl-single>
+ <xsl-chunked>classpath:/xslt/org/jboss/tools/xhtml-diff.xsl</xsl-chunked>
+ <xsl-pdf>classpath:/xslt/org/jboss/tools/pdf-diff.xsl</xsl-pdf>
</properties>
</profile>
</profiles>
@@ -28,7 +50,18 @@
<extensions>true</extensions>
<dependencies>
+ <dependency>
+ <groupId>com.jboss</groupId>
+ <artifactId>jbossent-docbook-xslt</artifactId>
+ <version>1.0.0</version>
+ </dependency>
<dependency>
+ <groupId>com.jboss</groupId>
+ <artifactId>jbossent-jdocbook-style</artifactId>
+ <version>1.0.0</version>
+ <type>jdocbook-style</type>
+ </dependency>
+ <dependency>
<groupId>org.jboss</groupId>
<artifactId>jbossorg-docbook-xslt</artifactId>
<version>1.1.0</version>
@@ -39,6 +72,11 @@
<version>1.1.0</version>
<type>jdocbook-style</type>
</dependency>
+ <dependency>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>jbosstools-docbook-xslt</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </dependency>
</dependencies>
<configuration>
@@ -55,19 +93,19 @@
</cssResource>
<formats>
- <format>
+ <format>
<formatName>pdf</formatName>
- <stylesheetResource>file:${pom.basedir}/${stylesdir}/xslt/org/jboss/tools/pdf.xsl</stylesheetResource>
+ <stylesheetResource>${xsl-pdf}</stylesheetResource>
<finalName>${pom.name}.pdf</finalName>
</format>
<format>
<formatName>html</formatName>
- <stylesheetResource>file:${pom.basedir}/${stylesdir}/xslt/org/jboss/tools/xhtml.xsl</stylesheetResource>
+ <stylesheetResource>${xsl-chunked}</stylesheetResource>
<finalName>index.html</finalName>
</format>
<format>
<formatName>html_single</formatName>
- <stylesheetResource>file:${pom.basedir}/${stylesdir}/xslt/org/jboss/tools/xhtml-single.xsl</stylesheetResource>
+ <stylesheetResource>${xsl-single}</stylesheetResource>
<finalName>index.html</finalName>
</format>
<format>
@@ -106,6 +144,9 @@
<properties>
<stylesdir>../../../documentation/jbosstools-docbook-xslt/src/main/resources/</stylesdir>
+ <xsl-single>classpath:/xslt/org/jboss/tools/xhtml-single.xsl</xsl-single>
+ <xsl-chunked>classpath:/xslt/org/jboss/tools/xhtml.xsl</xsl-chunked>
+ <xsl-pdf>classpath:/xslt/org/jboss/tools/pdf.xsl</xsl-pdf>
<cssdir>../../../documentation/jbosstools-jdocbook-style/src/main/org/css/</cssdir>
<master>master.xml</master>
<translation>en-US</translation>
Modified: trunk/jsf/docs/userguide/pom.xml
===================================================================
--- trunk/jsf/docs/userguide/pom.xml 2009-03-04 19:45:47 UTC (rev 13986)
+++ trunk/jsf/docs/userguide/pom.xml 2009-03-04 19:48:47 UTC (rev 13987)
@@ -10,11 +10,33 @@
<packaging>jdocbook</packaging>
<name>Visual_Web_Tools_Reference_Guide</name>
- <profiles>
+ <profiles>
<profile>
+ <id>release</id>
+ <properties>
+ <master>master_output.xml</master>
+ <xsl-single>classpath:/xslt/org/jboss/tools/xhtml-single-release.xsl</xsl-single>
+ <xsl-chunked>classpath:/xslt/org/jboss/tools/xhtml-release.xsl</xsl-chunked>
+ <xsl-pdf>classpath:/xslt/org/jboss/tools/pdf.xsl</xsl-pdf>
+ </properties>
+ </profile>
+ <profile>
+ <id>releaseJBDS</id>
+ <properties>
+ <master>master_output.xml</master>
+ <xsl-single>classpath:/xslt/com/jboss/tools/xhtml-single-release.xsl</xsl-single>
+ <xsl-chunked>classpath:/xslt/com/jboss/tools/xhtml-release.xsl</xsl-chunked>
+ <xsl-pdf>classpath:/xslt/com/jboss/tools/pdf.xsl</xsl-pdf>
+ <cssdir>../../../documentation/jbosstools-jdocbook-style/src/main/com/css/</cssdir>
+ </properties>
+ </profile>
+ <profile>
<id>diffmk</id>
<properties>
- <master>master_output.xml</master>
+ <master>master_output.xml</master>
+ <xsl-single>classpath:/xslt/org/jboss/tools/xhtml-single-diff.xsl</xsl-single>
+ <xsl-chunked>classpath:/xslt/org/jboss/tools/xhtml-diff.xsl</xsl-chunked>
+ <xsl-pdf>classpath:/xslt/org/jboss/tools/pdf-diff.xsl</xsl-pdf>
</properties>
</profile>
</profiles>
@@ -39,12 +61,22 @@
<version>1.0.0</version>
<type>jdocbook-style</type>
</dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-docbook-xslt</artifactId>
+ <version>1.1.0</version>
+ </dependency>
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jbossorg-jdocbook-style</artifactId>
<version>1.1.0</version>
<type>jdocbook-style</type>
</dependency>
+ <dependency>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>jbosstools-docbook-xslt</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </dependency>
</dependencies>
<configuration>
@@ -61,19 +93,19 @@
</cssResource>
<formats>
- <format>
- <formatName>pdf</formatName>
- <stylesheetResource>file:${pom.basedir}/${stylesdir}/xslt/com/jboss/tools/pdf.xsl</stylesheetResource>
+ <format>
+ <formatName>pdf</formatName>
+ <stylesheetResource>${xsl-pdf}</stylesheetResource>
<finalName>${pom.name}.pdf</finalName>
</format>
<format>
<formatName>html</formatName>
- <stylesheetResource>file:${pom.basedir}/${stylesdir}/xslt/com/jboss/tools/xhtml.xsl</stylesheetResource>
+ <stylesheetResource>${xsl-chunked}</stylesheetResource>
<finalName>index.html</finalName>
</format>
<format>
<formatName>html_single</formatName>
- <stylesheetResource>file:${pom.basedir}/${stylesdir}/xslt/com/jboss/tools/xhtml-single.xsl</stylesheetResource>
+ <stylesheetResource>${xsl-single}</stylesheetResource>
<finalName>index.html</finalName>
</format>
<format>
@@ -97,7 +129,10 @@
<properties>
<stylesdir>../../../documentation/jbosstools-docbook-xslt/src/main/resources/</stylesdir>
- <cssdir>../../../documentation/jbosstools-jdocbook-style/src/main/com/css/</cssdir>
+ <xsl-single>classpath:/xslt/org/jboss/tools/xhtml-single.xsl</xsl-single>
+ <xsl-chunked>classpath:/xslt/org/jboss/tools/xhtml.xsl</xsl-chunked>
+ <xsl-pdf>classpath:/xslt/org/jboss/tools/pdf.xsl</xsl-pdf>
+ <cssdir>../../../documentation/jbosstools-jdocbook-style/src/main/org/css/</cssdir>
<master>master.xml</master>
<translation>en-US</translation>
</properties>
17 years, 1 month
JBoss Tools SVN: r13986 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2009-03-04 14:45:47 -0500 (Wed, 04 Mar 2009)
New Revision: 13986
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3909
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java 2009-03-04 19:33:25 UTC (rev 13985)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java 2009-03-04 19:45:47 UTC (rev 13986)
@@ -117,6 +117,8 @@
// parameter indicates if dialog was opened from Wizard
private final boolean callFromWizard;
+
+ private Button addNewClass;
/**
@@ -351,9 +353,9 @@
}
});
//creates a button for add new class
- Button show = new Button(parent, SWT.PUSH);
- show.setText(JstUIMessages.BUTTON_ADD_NEW_STYLE_CLASS);
- show.addSelectionListener(new SelectionAdapter() {
+ addNewClass = new Button(parent, SWT.PUSH);
+ addNewClass.setText(JstUIMessages.BUTTON_ADD_NEW_STYLE_CLASS);
+ addNewClass.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
InputDialog dlg = new InputDialog(parent.getShell(),
JstUIMessages.ENTER_CSS_CLASS_NAME, JstUIMessages.ENTER_CSS_CLASS_NAME, classCombo.getText(),
@@ -843,8 +845,10 @@
cssValueStatus = new Status(IStatus.ERROR, notUsed, 0,
JstUIMessages.CSS_INVALID_STYLE_PROPERTY, null);
notifyListeners(event, cssValueStatus);
+ addNewClass.setEnabled(false);
} else {
cssValueStatus = null;
+ addNewClass.setEnabled(true);
notifyListeners(event, new Status(IStatus.OK, notUsed, 0,
JstUIMessages.CSS_STYLE_CLASS_EDITOR_DESCRIPTION, null));
}
17 years, 1 month
JBoss Tools SVN: r13985 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2009-03-04 14:33:25 -0500 (Wed, 04 Mar 2009)
New Revision: 13985
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3909
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java 2009-03-04 19:28:58 UTC (rev 13984)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java 2009-03-04 19:33:25 UTC (rev 13985)
@@ -842,8 +842,11 @@
if (!this.styleAttributes.isValid()) {
cssValueStatus = new Status(IStatus.ERROR, notUsed, 0,
JstUIMessages.CSS_INVALID_STYLE_PROPERTY, null);
+ notifyListeners(event, cssValueStatus);
} else {
cssValueStatus = null;
+ notifyListeners(event, new Status(IStatus.OK, notUsed, 0,
+ JstUIMessages.CSS_STYLE_CLASS_EDITOR_DESCRIPTION, null));
}
if (cssValueStatus != null && classCombo != null) {
classCombo.setEnabled(false);
17 years, 1 month
JBoss Tools SVN: r13984 - trunk/archives/tests/org.jboss.ide.eclipse.archives.test/inputs/ant.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2009-03-04 14:28:58 -0500 (Wed, 04 Mar 2009)
New Revision: 13984
Modified:
trunk/archives/tests/org.jboss.ide.eclipse.archives.test/inputs/ant/antTemplate.xml
Log:
ugly fix for SimpleAntTest, emma.jar added to classpath
Modified: trunk/archives/tests/org.jboss.ide.eclipse.archives.test/inputs/ant/antTemplate.xml
===================================================================
--- trunk/archives/tests/org.jboss.ide.eclipse.archives.test/inputs/ant/antTemplate.xml 2009-03-04 19:14:19 UTC (rev 13983)
+++ trunk/archives/tests/org.jboss.ide.eclipse.archives.test/inputs/ant/antTemplate.xml 2009-03-04 19:28:58 UTC (rev 13984)
@@ -12,6 +12,10 @@
name="plugins/org.jboss.ide.eclipse.archives.core**/archivescore.jar" />
<include name="plugins/org.jboss.ide.eclipse.archives.core**/lib/*.jar" />
</fileset>
+ <!-- in case of using emma during tests it is put in eclipse home -->
+ <fileset dir="${eclipse.home}">
+ <include name="emma.jar" />
+ </fileset>
</path>
<taskdef name="generate-archives" classpathref="generate-archives-classpath"
17 years, 1 month
JBoss Tools SVN: r13983 - in trunk/documentation/guides: GettingStartedGuide and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: artdaw
Date: 2009-03-04 14:14:19 -0500 (Wed, 04 Mar 2009)
New Revision: 13983
Modified:
trunk/documentation/guides/Exadel-migration/pom.xml
trunk/documentation/guides/GettingStartedGuide/pom.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-489 - three profiles were created
Modified: trunk/documentation/guides/Exadel-migration/pom.xml
===================================================================
--- trunk/documentation/guides/Exadel-migration/pom.xml 2009-03-04 18:50:54 UTC (rev 13982)
+++ trunk/documentation/guides/Exadel-migration/pom.xml 2009-03-04 19:14:19 UTC (rev 13983)
@@ -12,9 +12,30 @@
<profiles>
<profile>
+ <id>release</id>
+ <properties>
+ <master>master_output.xml</master>
+ <xsl-single>classpath:/xslt/com/jboss/tools/xhtml-single-release.xsl</xsl-single>
+ <xsl-chunked>classpath:/xslt/com/jboss/tools/xhtml-release.xsl</xsl-chunked>
+ <xsl-pdf>classpath:/xslt/com/jboss/tools/pdf.xsl</xsl-pdf>
+ </properties>
+ </profile>
+ <profile>
+ <id>releaseJBDS</id>
+ <properties>
+ <master>master_output.xml</master>
+ <xsl-single>classpath:/xslt/com/jboss/tools/xhtml-single-release.xsl</xsl-single>
+ <xsl-chunked>classpath:/xslt/com/jboss/tools/xhtml-release.xsl</xsl-chunked>
+ <xsl-pdf>classpath:/xslt/com/jboss/tools/pdf.xsl</xsl-pdf>
+ </properties>
+ </profile>
+ <profile>
<id>diffmk</id>
<properties>
- <master>master_output.xml</master>
+ <master>master_output.xml</master>
+ <xsl-single>classpath:/xslt/com/jboss/tools/xhtml-single-diff.xsl</xsl-single>
+ <xsl-chunked>classpath:/xslt/com/jboss/tools/xhtml-diff.xsl</xsl-chunked>
+ <xsl-pdf>classpath:/xslt/com/jboss/tools/pdf-diff.xsl</xsl-pdf>
</properties>
</profile>
</profiles>
@@ -44,6 +65,11 @@
<version>1.1.0</version>
<type>jdocbook-style</type>
</dependency>
+ <dependency>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>jbosstools-docbook-xslt</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </dependency>
</dependencies>
<configuration>
<sourceDocumentName>${master}</sourceDocumentName>
@@ -61,22 +87,22 @@
<formats>
<format>
<formatName>pdf</formatName>
- <stylesheetResource>file:${pom.basedir}/${stylesdir}/xslt/com/jboss/tools/pdf.xsl</stylesheetResource>
+ <stylesheetResource>${xsl-pdf}</stylesheetResource>
<finalName>${pom.name}.pdf</finalName>
</format>
<format>
<formatName>html</formatName>
- <stylesheetResource>file:${pom.basedir}/${stylesdir}/xslt/com/jboss/tools/xhtml.xsl</stylesheetResource>
+ <stylesheetResource>${xsl-chunked}</stylesheetResource>
<finalName>index.html</finalName>
</format>
<format>
<formatName>html_single</formatName>
- <stylesheetResource>file:${pom.basedir}/${stylesdir}/xslt/com/jboss/tools/xhtml-single.xsl</stylesheetResource>
+ <stylesheetResource>${xsl-single}</stylesheetResource>
<finalName>index.html</finalName>
</format>
<format>
<formatName>eclipse</formatName>
- <stylesheetResource>file:${pom.basedir}/${stylesdir}/xslt/com/jboss/tools/eclipse.xsl</stylesheetResource>
+ <stylesheetResource>classpath:/xslt/com/jboss/tools/eclipse.xsl</stylesheetResource>
<finalName>index.html</finalName>
</format>
</formats>
@@ -108,6 +134,9 @@
</distributionManagement>
<properties>
+ <xsl-single>classpath:/xslt/com/jboss/tools/xhtml-single.xsl</xsl-single>
+ <xsl-chunked>classpath:/xslt/com/jboss/tools/xhtml.xsl</xsl-chunked>
+ <xsl-pdf>classpath:/xslt/com/jboss/tools/pdf.xsl</xsl-pdf>
<stylesdir>../../../documentation/jbosstools-docbook-xslt/src/main/resources/</stylesdir>
<cssdir>../../../documentation/jbosstools-jdocbook-style/src/main/com/css/</cssdir>
<master>master.xml</master>
Modified: trunk/documentation/guides/GettingStartedGuide/pom.xml
===================================================================
--- trunk/documentation/guides/GettingStartedGuide/pom.xml 2009-03-04 18:50:54 UTC (rev 13982)
+++ trunk/documentation/guides/GettingStartedGuide/pom.xml 2009-03-04 19:14:19 UTC (rev 13983)
@@ -10,11 +10,32 @@
<packaging>jdocbook</packaging>
<name>Getting_Started_Guide</name>
- <profiles>
+ <profiles>
<profile>
+ <id>release</id>
+ <properties>
+ <master>master_output.xml</master>
+ <xsl-single>classpath:/xslt/com/jboss/tools/xhtml-single-release.xsl</xsl-single>
+ <xsl-chunked>classpath:/xslt/com/jboss/tools/xhtml-release.xsl</xsl-chunked>
+ <xsl-pdf>classpath:/xslt/com/jboss/tools/pdf.xsl</xsl-pdf>
+ </properties>
+ </profile>
+ <profile>
+ <id>releaseJBDS</id>
+ <properties>
+ <master>master_output.xml</master>
+ <xsl-single>classpath:/xslt/com/jboss/tools/xhtml-single-release.xsl</xsl-single>
+ <xsl-chunked>classpath:/xslt/com/jboss/tools/xhtml-release.xsl</xsl-chunked>
+ <xsl-pdf>classpath:/xslt/com/jboss/tools/pdf.xsl</xsl-pdf>
+ </properties>
+ </profile>
+ <profile>
<id>diffmk</id>
<properties>
- <master>master_output.xml</master>
+ <master>master_output.xml</master>
+ <xsl-single>classpath:/xslt/com/jboss/tools/xhtml-single-diff.xsl</xsl-single>
+ <xsl-chunked>classpath:/xslt/com/jboss/tools/xhtml-diff.xsl</xsl-chunked>
+ <xsl-pdf>classpath:/xslt/com/jboss/tools/pdf-diff.xsl</xsl-pdf>
</properties>
</profile>
</profiles>
@@ -45,7 +66,11 @@
<version>1.1.0</version>
<type>jdocbook-style</type>
</dependency>
-
+ <dependency>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>jbosstools-docbook-xslt</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </dependency>
</dependencies>
<configuration>
@@ -62,28 +87,28 @@
<directory>${pom.basedir}/${cssdir}</directory>
</cssResource>
- <formats>
- <format>
- <formatName>pdf</formatName>
- <stylesheetResource>file:${pom.basedir}/${stylesdir}/xslt/com/jboss/tools/pdf.xsl</stylesheetResource>
- <finalName>${pom.name}.pdf</finalName>
- </format>
- <format>
- <formatName>html</formatName>
- <stylesheetResource>file:${pom.basedir}/${stylesdir}/xslt/com/jboss/tools/xhtml.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- <format>
- <formatName>html_single</formatName>
- <stylesheetResource>file:${pom.basedir}/${stylesdir}/xslt/com/jboss/tools/xhtml-single.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- <format>
- <formatName>eclipse</formatName>
- <stylesheetResource>file:${pom.basedir}/${stylesdir}/xslt/com/jboss/tools/eclipse.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- </formats>
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+ <stylesheetResource>${xsl-pdf}</stylesheetResource>
+ <finalName>${pom.name}.pdf</finalName>
+ </format>
+ <format>
+ <formatName>html</formatName>
+ <stylesheetResource>${xsl-chunked}</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource>${xsl-single}</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>eclipse</formatName>
+ <stylesheetResource>classpath:/xslt/com/jboss/tools/eclipse.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
<options>
<useRelativeImageUris>
@@ -102,8 +127,12 @@
</build>
<properties>
+ <xsl-single>classpath:/xslt/com/jboss/tools/xhtml-single.xsl</xsl-single>
+ <xsl-chunked>classpath:/xslt/com/jboss/tools/xhtml.xsl</xsl-chunked>
+ <xsl-pdf>classpath:/xslt/com/jboss/tools/pdf.xsl</xsl-pdf>
+ <stylesdir>../../../documentation/jbosstools-docbook-xslt/src/main/resources/</stylesdir>
+ <cssdir>../../../documentation/jbosstools-jdocbook-style/src/main/com/css/</cssdir>
<stylesdir>../../../documentation/jbosstools-docbook-xslt/src/main/resources/</stylesdir>
- <cssdir>../../../documentation/jbosstools-jdocbook-style/src/main/com/css/</cssdir>
<master>master.xml</master>
<translation>en-US</translation>
</properties>
17 years, 1 month
JBoss Tools SVN: r13982 - in trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp: outline/cssdialog and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2009-03-04 13:50:54 -0500 (Wed, 04 Mar 2009)
New Revision: 13982
Added:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSValidator.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/JstUIMessages.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/messages.properties
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/StyleComposite.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/events/StyleAttributes.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3909
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/JstUIMessages.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/JstUIMessages.java 2009-03-04 18:44:37 UTC (rev 13981)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/JstUIMessages.java 2009-03-04 18:50:54 UTC (rev 13982)
@@ -104,4 +104,5 @@
public static String BUTTON_ADD_NEW_STYLE_CLASS;
public static String ENTER_CSS_CLASS_NAME;
public static String CSS_CLASS_NAME_NOT_VALID;
+ public static String CSS_INVALID_STYLE_PROPERTY;
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/messages.properties
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/messages.properties 2009-03-04 18:44:37 UTC (rev 13981)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/messages.properties 2009-03-04 18:50:54 UTC (rev 13982)
@@ -8,6 +8,7 @@
CSS_STYLE_EDITOR_TITLE=CSS Style
CSS_EMPTY_FILE_PATH_MESSAGE=Choose any CSS file
CSS_EMPTY_STYLE_CLASS_MESSAGE=Style class is empty
+CSS_INVALID_STYLE_PROPERTY=Invalid Style class property has been entered.Preview Tab will be not updated.
CSS_SAVE_DIALOG_TITLE=Save CSS file
CSS_SAVE_DIALOG_MESSAGE=CSS file has been changed.\nWould you like to save changes?
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java 2009-03-04 18:44:37 UTC (rev 13981)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java 2009-03-04 18:50:54 UTC (rev 13982)
@@ -50,6 +50,7 @@
import org.jboss.tools.common.model.ui.widgets.Split;
import org.jboss.tools.jst.jsp.messages.JstUIMessages;
import org.jboss.tools.jst.jsp.outline.cssdialog.common.CSSModel;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.CSSValidator;
import org.jboss.tools.jst.jsp.outline.cssdialog.common.Constants;
import org.jboss.tools.jst.jsp.outline.cssdialog.common.Util;
import org.jboss.tools.jst.jsp.outline.cssdialog.events.ChangeStyleEvent;
@@ -64,7 +65,7 @@
*
* @author Igor Zhukov (izhukov(a)exadel.com)
*/
-public class CSSClassDialog extends TitleAreaDialog {
+public class CSSClassDialog extends TitleAreaDialog implements ChangeStyleListener {
public static final String ID = "org.jboss.tools.jst.jsp.outline.cssdialog.CSSClassDialog"; //$NON-NLS-1$
@@ -108,6 +109,8 @@
private IStatus filePathStatus = null;
// 2. holds an error if the destination class style is empty
private IStatus classNameStatus = null;
+ // 3. holds an error if inccorrect property was specified
+ private IStatus cssValueStatus =null;
// an array of subscribed message dialog listener
private ArrayList<MessageDialogListener> errorListeners = new ArrayList<MessageDialogListener>();
@@ -115,12 +118,6 @@
// parameter indicates if dialog was opened from Wizard
private final boolean callFromWizard;
- // this job is used to correctly process change style class combo text with delay
-// private UIJob uiJob = null;
- // the job name
-// private String jobName = "Update CSS Composite"; //$NON-NLS-1$
-// // delay for job in milliseconds
-// private int delay = 1000;
/**
* Constructor.
@@ -138,6 +135,7 @@
classNameStatus = new Status(IStatus.ERROR, notUsed, 0, JstUIMessages.CSS_EMPTY_STYLE_CLASS_MESSAGE, null);
styleAttributes = new StyleAttributes();
+ styleAttributes.addChangeStyleListener(this);
this.callFromWizard = callFromWizard;
this.selection = selection;
init();
@@ -164,7 +162,6 @@
if (currentFile == null) {
currentFile = Util.getActiveCssFile();
}
-// currentClassStyle = Util.getActivePageCSSSelectorIfAny();
}
/**
@@ -253,7 +250,7 @@
styleChanged = true;
if (currentClassStyle != null && !currentClassStyle.equals(Constants.EMPTY)
&& currentFile != null && !currentFile.equals(Constants.EMPTY)) {
- applyButton.setEnabled(true);
+ updateApplyButton(true);
}
}
});
@@ -281,16 +278,6 @@
// add content assist to style COMBO component
SimpleContentProposalProvider proposalProvider = new SimpleContentProposalProvider(classCombo.getItems());
proposalProvider.setFiltering(true);
-// contentAssistAdapter = new ContentAssistCommandAdapter(
-// classCombo, new ComboContentAdapter(), proposalProvider, null, null, true);
-// contentAssistAdapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
-// contentAssistAdapter.addContentProposalListener(new IContentProposalListener() {
-// public void proposalAccepted(IContentProposal proposal) {
-// cssStyleClassChanged();
-// applyButton.setEnabled(false);
-// keyInputSelector = false;
-// }
-// });
split.setWeights(new int[]{15, 85});
split.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, true));
@@ -324,80 +311,6 @@
applyToStatusLine(status);
}
});
-
-// Button button = new Button(parent, SWT.PUSH);
-// button.setLayoutData(new GridData(GridData.END, GridData.CENTER, false, false));
-//
-// ImageDescriptor imageDesc = JspEditorPlugin.getImageDescriptor(Constants.IMAGE_FOLDERLARGE_FILE_LOCATION);
-// Image image = imageDesc.createImage();
-// button.setImage(image);
-// button.setToolTipText(JstUIMessages.CSS_BROWSE_BUTTON_TOOLTIP);
-// button.addDisposeListener(new DisposeListener() {
-// public void widgetDisposed(DisposeEvent e) {
-// Button button = (Button) e.getSource();
-// button.getImage().dispose();
-// }
-// });
-// button.addSelectionListener(new SelectionAdapter() {
-// public void widgetSelected(SelectionEvent event) {
-//// IResource project = Util.getCurrentProject();
-// IResource project = ResourcesPlugin.getWorkspace().getRoot();
-//
-// ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(),
-// new WorkbenchLabelProvider(), new BaseWorkbenchContentProvider());
-// dialog.addFilter(new FileExtensionFilter(fileExtensions));
-// dialog.setTitle(JstUIMessages.CSS_FILE_SELECT_DIALOG_TITLE);
-// dialog.setMessage(JstUIMessages.CSS_FILE_SELECT_DIALOG_LABEL);
-// dialog.setInput(project);
-// dialog.setAllowMultiple(false);
-// dialog.setDoubleClickSelects(false);
-// if (currentFile != null) {
-// dialog.setInitialSelection(currentFile);
-// }
-// dialog.setEmptyListMessage(JstUIMessages.CSS_FILE_SELECT_DIALOG_EMPTY_MESSAGE);
-//
-// if (dialog.open() == Window.OK) {
-// IResource res = (IResource) dialog.getFirstResult();
-// // make some important saving actions
-// if (res instanceof IFile) {
-// if (styleChanged && currentFile != null) {
-// MessageBox messageBox = new MessageBox(getParentShell(), SWT.YES | SWT.NO | SWT.ICON_QUESTION);
-// messageBox.setText(JstUIMessages.CSS_SAVE_DIALOG_TITLE);
-// messageBox.setMessage(CSSClassDialog.getMessageForSaveDialog(currentFile));
-// int result = messageBox.open();
-// if (result == SWT.YES) {
-// saveChanges(true);
-// } else {
-// updateStyleComposite();
-// }
-// }
-// styleComposite.revertPreview();
-// releaseResources();
-//
-// // open new CSS file and initialize dialog
-// boolean useRelativePath = true;
-// if (project instanceof IWorkspaceRoot) {
-// useRelativePath = false;
-// }
-// boolean updateCSSModel = false;
-// if (currentFile != null && !currentFile.equals(Constants.EMPTY)) {
-// currentClassStyle = null;
-// updateCSSModel = true;
-// }
-// currentFile = (IFile)res;
-// initCSSModel(currentFile, useRelativePath, updateCSSModel);
-// updateOKButtonState();
-// applyButton.setEnabled(false);
-// styleChanged = false;
-//
-// // update content assist proposals
-// SimpleContentProposalProvider proposalProvider =
-// (SimpleContentProposalProvider)contentAssistAdapter.getContentProposalProvider();
-// proposalProvider.setProposals(classCombo.getItems());
-// }
-// }
-// }
-// });
}
/**
@@ -415,24 +328,6 @@
classCombo = new Combo(parent, SWT.BORDER|SWT.READ_ONLY);
classCombo.setLayoutData(gridData);
- // add selection listener
-// classCombo.addSelectionListener(new SelectionAdapter() {
-// public void widgetSelected(SelectionEvent e) {
-// if (keyInputSelector) {
-// keyInputSelector = false;
-// if (currentClassStyle != null && classCombo.indexOf(currentClassStyle) != -1) {
-// return;
-// }
-// }
-// keyInputSelector = false;
-// }
-// });
- // add key modified listener
-// classCombo.addKeyListener(new KeyAdapter() {
-// public void keyReleased(KeyEvent e) {
-// keyInputSelector = true;
-// }
-// });
// this listener is responsible for processing dialog header message events
classCombo.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
@@ -452,7 +347,7 @@
return;
}
cssStyleClassChanged();
- applyButton.setEnabled(false);
+ updateApplyButton(false);
}
});
//creates a button for add new class
@@ -485,7 +380,7 @@
* @param styleClassName - name of new style class
*/
public void addNewStyleClass(String styleClassName) {
- applyButton.setEnabled(true);
+ updateApplyButton(true);
styleChanged = true;
currentClassStyle = styleClassName;
updateStyleComposite();
@@ -546,7 +441,7 @@
buttonComposite.setLayout(new GridLayout());
// add APPLY button
applyButton = createCustomButton(buttonComposite, JstUIMessages.BUTTON_APPLY);
- applyButton.setEnabled(false);
+ updateApplyButton(false);
applyButton.setToolTipText(JstUIMessages.CSS_APPLY_CHANGES);
applyButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
@@ -556,7 +451,7 @@
classCombo.add(currentClassStyle);
}
saveChanges(false);
- applyButton.setEnabled(false);
+ updateApplyButton(false);
styleChanged = false;
}
}
@@ -569,7 +464,7 @@
styleComposite.clearStyleComposite(currentClassStyle);
styleComposite.updatePreview(currentClassStyle);
styleComposite.updateStyle();
- applyButton.setEnabled(true);
+ updateApplyButton(true);
styleChanged = true;
}
});
@@ -626,7 +521,7 @@
// } else {
// styleChanged = false;
// }
- applyButton.setEnabled(true);
+ updateApplyButton(true);
styleChanged = true;
updateStyleComposite();
@@ -701,7 +596,7 @@
private void updateOKButtonState() {
Button okButton = getButton(IDialogConstants.OK_ID);
if (okButton != null) {
- if (currentClassStyle == null || currentClassStyle.equals(Constants.EMPTY) || currentFile == null) {
+ if (findMostSevere()!=null&&findMostSevere().getSeverity()==IStatus.ERROR) {
okButton.setEnabled(false);
} else {
okButton.setEnabled(true);
@@ -890,10 +785,15 @@
if (classNameStatus.matches(IStatus.ERROR)) {
return classNameStatus;
}
- if (filePathStatus.getSeverity() > classNameStatus.getSeverity()) {
- return filePathStatus;
+ if(cssValueStatus!=null && cssValueStatus.matches(IStatus.ERROR)){
+ return cssValueStatus;
}
- else return classNameStatus;
+ if(cssValueStatus!=null && cssValueStatus.matches(IStatus.ERROR)){
+ return cssValueStatus;
+ } else {
+ return classNameStatus;
+ }
+
}
/**
@@ -934,4 +834,38 @@
public void setCurrentFile(IFile currentFile) {
this.currentFile = currentFile;
}
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.jsp.outline.cssdialog.events.ChangeStyleListener#styleChanged(org.jboss.tools.jst.jsp.outline.cssdialog.events.ChangeStyleEvent)
+ */
+ public void styleChanged(ChangeStyleEvent event) {
+ if (!this.styleAttributes.isValid()) {
+ cssValueStatus = new Status(IStatus.ERROR, notUsed, 0,
+ JstUIMessages.CSS_INVALID_STYLE_PROPERTY, null);
+ } else {
+ cssValueStatus = null;
+ }
+ if (cssValueStatus != null && classCombo != null) {
+ classCombo.setEnabled(false);
+ } else {
+ classCombo.setEnabled(true);
+
+ }
+ updateApplyButton(true);
+ updateOKButtonState();
+ applyToStatusLine(findMostSevere());
+ }
+ /**
+ * Update upplyButtonState
+ * @param available
+ */
+ private void updateApplyButton(boolean enabled){
+ if(cssValueStatus!=null
+ &&cssValueStatus.matches(IStatus.ERROR)) {
+ applyButton.setEnabled(false);
+ }else {
+ applyButton.setEnabled(enabled);
+ }
+
+ }
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/StyleComposite.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/StyleComposite.java 2009-03-04 18:44:37 UTC (rev 13981)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/StyleComposite.java 2009-03-04 18:50:54 UTC (rev 13982)
@@ -237,6 +237,11 @@
tabBoxesControl.updateData(false);
lastSelectedTab = tabBoxes;
} else if (tabFolder.getSelection()[FIRST_SELECTION] == tabPreview) {
+ if(!styleAttributes.isValid()){
+ //mareshkau, if styles attributes not valid we cann't create
+ //correct preview
+ return;
+ }
cssModel.setCSS(styleAttributes.getCssSelector(), styleAttributes);
tabPreviewControl.selectEditorArea(styleAttributes.getCssSelector(), 0);
lastSelectedTab = tabPreview;
Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSValidator.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSValidator.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSValidator.java 2009-03-04 18:50:54 UTC (rev 13982)
@@ -0,0 +1,135 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.jsp.outline.cssdialog.common;
+
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+
+import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.jboss.tools.jst.jsp.JspEditorPlugin;
+import org.w3c.dom.css.CSSStyleDeclaration;
+import org.w3c.dom.css.CSSStyleRule;
+import org.w3c.dom.css.CSSStyleSheet;
+
+/**
+ * CSS Validator
+ *
+ * @author yradtsevich
+ *
+ */
+public class CSSValidator {
+ // FIXME: this hard-coded string have to be replaced by reference
+ private static final String CSS_CONTENT_TYPE_IDENTIFIER = "org.eclipse.wst.css.core.csssource"; //$NON-NLS-1$
+ private final CSSStyleSheet validatingCSS;
+ private final LogHacker logHacker = new LogHacker();
+
+ @SuppressWarnings("restriction")
+ public CSSValidator() {
+ IModelManager modelManager = StructuredModelManager.getModelManager();
+ ICSSModel validatingModel = (ICSSModel) modelManager.createUnManagedStructuredModelFor(CSS_CONTENT_TYPE_IDENTIFIER);
+
+ validatingCSS = (CSSStyleSheet) validatingModel.getDocument();
+ }
+
+ private void cleanValidatingCSS() {
+ int ruleNumber;
+
+ while ((ruleNumber = validatingCSS.getCssRules().getLength()) > 0) {
+ validatingCSS.deleteRule(ruleNumber - 1);
+ }
+ }
+
+ /**
+ * Validates value of a CSS attribute.
+ *
+ * @param value the
+ * @return {@code true} if the attribute is valid, {@code false} otherwise
+ */
+ public boolean isValidValue(String value) {
+ logHacker.disableLogging();
+ boolean valid = true;
+ try {
+ validatingCSS.insertRule(".testSelector {}", 0); //$NON-NLS-1$
+ CSSStyleRule cssRule = ((CSSStyleRule) validatingCSS.getCssRules().item(0));
+ CSSStyleDeclaration declaration = cssRule.getStyle();
+ declaration.setProperty("background", value, Constants.EMPTY); //$NON-NLS-1$
+ } catch (Throwable e) {
+ valid = false;
+ } finally {
+ logHacker.enableLogging();
+ cleanValidatingCSS();
+ }
+
+ return valid;
+ }
+
+ /**
+ * Validates CSS selector value.
+ *
+ * @param selector the selector value
+ * @return {@code true} if the selector is valid, {@code false} otherwise
+ */
+ public boolean isValidSelector(String selector) {
+ boolean valid = true;
+ try {
+ validatingCSS.insertRule(selector + " {}", 0); //$NON-NLS-1$
+ } catch (Throwable e) {
+ valid = false;
+ } finally {
+ cleanValidatingCSS();
+ }
+
+ return valid;
+ }
+
+ /**
+ * Gives opportunity to delete all loggers from {@link org.eclipse.core.internal.runtime.RuntimeLog}
+ *
+ * @author yradtsevich
+ *
+ */
+ private class LogHacker {
+ private Field logListeners = null;
+ private Object oldValue = null;
+
+ public LogHacker() {
+ try {
+ logListeners = org.eclipse.core.internal.runtime.RuntimeLog.class.getDeclaredField("logListeners");
+ logListeners.setAccessible(true);
+ } catch (Throwable e) {
+ JspEditorPlugin.getPluginLog().logError(e);
+ }
+ }
+
+ public void disableLogging() {
+ try {
+ oldValue = logListeners.get(null);
+ logListeners.set(null, new ArrayList(0));
+ } catch (Throwable e) {
+ JspEditorPlugin.getPluginLog().logError(e);
+ }
+ }
+
+ public void enableLogging() {
+ try {
+ if (oldValue != null) {
+ logListeners.set(null, oldValue);
+ }
+ } catch (Throwable e) {
+ JspEditorPlugin.getPluginLog().logError(e);
+ } finally {
+ oldValue = null;
+ }
+ }
+ }
+}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/events/StyleAttributes.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/events/StyleAttributes.java 2009-03-04 18:44:37 UTC (rev 13981)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/events/StyleAttributes.java 2009-03-04 18:50:54 UTC (rev 13982)
@@ -16,6 +16,7 @@
import java.util.Set;
import java.util.Map.Entry;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.CSSValidator;
import org.jboss.tools.jst.jsp.outline.cssdialog.common.Constants;
/**
@@ -26,12 +27,13 @@
private String cssSelector = null;
private HashMap<String, String> attributeMap = null;
private ArrayList<ChangeStyleListener> listeners = new ArrayList<ChangeStyleListener>();
-
+ private CSSValidator cssValidator;
/**
* Default constructor.
*/
public StyleAttributes() {
this.attributeMap = new HashMap<String, String>();
+ cssValidator = new CSSValidator();
}
/**
@@ -158,7 +160,7 @@
public String getCssSelector() {
return cssSelector;
}
-
+
/**
* String representation of style attributes.
*
@@ -173,4 +175,16 @@
}
return buf.toString();
}
+ /**
+ * Checks if attributes that has been entered to style valid
+ * @return
+ */
+ public boolean isValid() {
+ for(String value : getAttributeMap().values()) {
+ if(!cssValidator.isValidValue(value)) {
+ return false;
+ }
+ }
+ return true;
+ }
}
17 years, 1 month
JBoss Tools SVN: r13981 - trunk/birt/docs/en/modules.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2009-03-04 13:44:37 -0500 (Wed, 04 Mar 2009)
New Revision: 13981
Modified:
trunk/birt/docs/en/modules/birt_integration.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-388
images are renamed according to what is shown on them
Modified: trunk/birt/docs/en/modules/birt_integration.xml
===================================================================
--- trunk/birt/docs/en/modules/birt_integration.xml 2009-03-04 18:41:20 UTC (rev 13980)
+++ trunk/birt/docs/en/modules/birt_integration.xml 2009-03-04 18:44:37 UTC (rev 13981)
@@ -391,16 +391,15 @@
</figure>
<figure>
- <title>Adding "Birt Reporting Runtime Component" Facet </title>
+ <title>Testing Connection</title>
<mediaobject>
<imageobject>
- <imagedata fileref="images/BirtIntegration/AddingBirtFacet.png"/>
+ <imagedata fileref="images/BirtIntegration/TestingConnection.png"/>
</imageobject>
</mediaobject>
</figure>
-
-
+
<orderedlist>
<listitem>
<para>add the Hibernate ODA dataset</para>
@@ -408,10 +407,10 @@
</orderedlist>
<figure>
- <title>Adding "Birt Reporting Runtime Component" Facet </title>
+ <title>Adding </title>
<mediaobject>
<imageobject>
- <imagedata fileref="images/BirtIntegration/AddingBirtFacet.png"/>
+ <imagedata fileref="images/BirtIntegration/AddingHibernateODADataset.png"/>
</imageobject>
</mediaobject>
</figure>
17 years, 1 month