JBoss Tools SVN: r12180 - in documentation/trunk/movies: seam_demo and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2008-12-01 12:20:27 -0500 (Mon, 01 Dec 2008)
New Revision: 12180
Modified:
documentation/trunk/movies/index/en/master.xml
documentation/trunk/movies/seam_demo/seam_demo_part1.wnk
documentation/trunk/movies/seam_demo/seam_demo_part2.wnk
Log:
https://jira.jboss.org/jira/browse/JBDS-352
the index page of demos is updates, as 2 new demos were added
and demo itself is updated, language in hints is checked
Modified: documentation/trunk/movies/index/en/master.xml
===================================================================
--- documentation/trunk/movies/index/en/master.xml 2008-12-01 17:12:50 UTC (rev 12179)
+++ documentation/trunk/movies/index/en/master.xml 2008-12-01 17:20:27 UTC (rev 12180)
@@ -86,13 +86,16 @@
</para>
<para>The online demo shows all the basics you'll need to create such application</para>
</listitem>
-
- <listitem>
+
+<listitem>
<para>
<ulink url="demos/ootb_new_seam_project/new_seam_project.htm">New Seam Project</ulink>
</para>
- <para>This movie shows you step-by-step how to crete a new seam project</para>
+ <para>This movie shows you step-by-step how to crete a new seam project</para><para/>
</listitem>
+
+ <listitem><para>This three-part demo showing how to create a database driven application using Seam</para>
+ <itemizedlist>
<listitem>
<para>
@@ -100,17 +103,21 @@
</para>
<para>The movie shows how to use establish database connection and reverse engineer a database table</para>
</listitem>
-
-
- <listitem>
+
+ <listitem>
<para>
<ulink url="demos/building_web_page_using_JSF_RichFaces_Facelets/building_web_page_using_JSF_RichFaces_Facelets.htm">Building a web page using JSF, RichFaces, Facelets</ulink>
</para>
<para>In this part of the video cast about Seam it will be shown how to create a web page that displays database entries and adds a new entry to the database reusing generated code. You will practically learn how to use JSF, RichFaces and Facelets.</para>
- </listitem>
+ </listitem>
+
+ </itemizedlist>
+</listitem>
+
+
</itemizedlist>
<itemizedlist>
<title>Project Archives Demos</title>
Modified: documentation/trunk/movies/seam_demo/seam_demo_part1.wnk
===================================================================
(Binary files differ)
Modified: documentation/trunk/movies/seam_demo/seam_demo_part2.wnk
===================================================================
(Binary files differ)
15 years, 5 months
JBoss Tools SVN: r12179 - in trunk/jst/plugins: org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: izhukov
Date: 2008-12-01 12:12:50 -0500 (Mon, 01 Dec 2008)
New Revision: 12179
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/CSSStyleDialog.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/common/CSSModel.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/Constants.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/Util.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabBackgroundControl.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabBoxesControl.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabPreviewControl.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabPropertySheetControl.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabTextControl.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/css/NewCSSClassWizard.java
Log:
JBIDE-2648, JBIDE-3294
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 2008-12-01 17:12:48 UTC (rev 12178)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/JstUIMessages.java 2008-12-01 17:12:50 UTC (rev 12179)
@@ -54,6 +54,7 @@
public static String CSS_BROWSE_BUTTON_TOOLTIP;
public static String CSS_CLASS_DIALOG_STYLE_CLASS_LABEL;
public static String CSS_CLEAR_STYLE_SHEET;
+ public static String CSS_APPLY_CHANGES;
public static String ADD_FONT_FAMILY_TIP;
public static String REMOVE_FONT_FAMILY_TIP;
public static String FONT_SIZE;
@@ -94,7 +95,9 @@
public static String COLOR_TIP;
public static String TEXT_DECORATION;
public static String TEXT_ALIGN;
+ public static String BUTTON_APPLY;
public static String BUTTON_CLEAR;
public static String PREVIEW_SHEET_TAB_NAME;
public static String DEFAULT_PREVIEW_TEXT;
+ public static String DEFAULT_TEXT_FOR_BROWSER_PREVIEW;
}
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 2008-12-01 17:12:48 UTC (rev 12178)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/messages.properties 2008-12-01 17:12:50 UTC (rev 12179)
@@ -16,11 +16,12 @@
CSS_BROWSE_BUTTON_TOOLTIP=Browse
CSS_CLEAR_STYLE_SHEET=Clear style sheet
+CSS_APPLY_CHANGES=Apply changes
-
ADD_FONT_FAMILY_TIP=Add font family
REMOVE_FONT_FAMILY_TIP=Remove font family
FONT_FAMILY_DIALOG_TITLE=Choose font family
+BUTTON_APPLY=Apply
BUTTON_CLEAR=Clear
IMAGE_COMBO_TABLE_TOOL_TIP=Double click to select color
@@ -72,3 +73,4 @@
PADDING=Padding:
DEFAULT_PREVIEW_TEXT=CSS file to edit will be displayed here
+DEFAULT_TEXT_FOR_BROWSER_PREVIEW=Double click to edit preview. To save changes press Enter button.
\ No newline at end of file
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 2008-12-01 17:12:48 UTC (rev 12178)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java 2008-12-01 17:12:50 UTC (rev 12179)
@@ -18,10 +18,16 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.TitleAreaDialog;
+import org.eclipse.jface.fieldassist.ComboContentAdapter;
+import org.eclipse.jface.fieldassist.ContentProposalAdapter;
+import org.eclipse.jface.fieldassist.IContentProposal;
+import org.eclipse.jface.fieldassist.IContentProposalListener;
+import org.eclipse.jface.fieldassist.SimpleContentProposalProvider;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.window.Window;
@@ -30,14 +36,14 @@
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.FocusAdapter;
import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Image;
@@ -52,6 +58,7 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
+import org.eclipse.ui.fieldassist.ContentAssistCommandAdapter;
import org.eclipse.ui.model.BaseWorkbenchContentProvider;
import org.eclipse.ui.model.WorkbenchLabelProvider;
import org.jboss.tools.common.model.ui.widgets.Split;
@@ -71,19 +78,20 @@
/**
* This dialog represents CSSClass dialog.
+ *
+ * @author Igor Zhukov (izhukov(a)exadel.com)
*/
-public class CSSClassDialog extends TitleAreaDialog implements MouseListener, FocusListener {
+public class CSSClassDialog extends TitleAreaDialog {
public static final String ID = "org.jboss.tools.jst.jsp.outline.cssdialog.CSSClassDialog"; //$NON-NLS-1$
private static String notUsed = "not_used"; //$NON-NLS-1$
private final static String[] fileExtensions = { Util.CSS_FILE_EXTENTION };
- private final static String SKIP_FIRST_CHAR = "."; //$NON-NLS-1$
private Composite browserContainer = null;
private Browser browser = null;
private Text textBrowser = null;
- private String previewBrowserValue = Constants.TEXT_FOR_PREVIEW;
+ private String previewBrowserValue = JstUIMessages.DEFAULT_TEXT_FOR_BROWSER_PREVIEW;
private StyleComposite styleComposite = null;
private StyleAttributes styleAttributes = null;
@@ -91,6 +99,10 @@
private Text text;
// css style classes
private Combo classCombo;
+ // combo box content assist
+ private ContentAssistCommandAdapter contentAssistAdapter = null;
+ // apply button
+ private Button applyButton;
// model is the core of the CSS Class Dialog, it manages style attributes
private CSSModel cssModel;
@@ -106,6 +118,8 @@
private boolean styleChanged = false;
+ private boolean keyInputSelector = false;
+
// Status variables for the possible errors on this page.
// 1. timeStatus holds an error if CSS file is not specified
private IStatus filePathStatus = null;
@@ -168,22 +182,7 @@
* @param currentClassStyle String value
*/
public void setCurrentStyleClass(String currentClassStyle) {
- if (currentClassStyle != null && !currentClassStyle.equals(Constants.EMPTY)) {
- String[] styleClasses = currentClassStyle.split("\\s++"); //$NON-NLS-1$
- StringBuffer sb = new StringBuffer();
- for (int i = 0; i < styleClasses.length; i++) {
- String value = styleClasses[i];
- // check if first symbol doesn't specify some special CSS symbols
- if (!value.startsWith("#")) { //$NON-NLS-1$
- sb.append(SKIP_FIRST_CHAR);
- }
- sb.append(value);
- if (i != (styleClasses.length - 1)) {
- sb.append(Constants.WHITE_SPACE);
- }
- }
- this.currentClassStyle = sb.toString().trim();
- }
+ this.currentClassStyle = Util.formatStyleClassToCSSView(currentClassStyle);
}
/**
@@ -204,6 +203,7 @@
updateOKButtonState();
}
+ private Split split;
/**
* Create the dialog itself.
*
@@ -215,34 +215,98 @@
setTitle(JstUIMessages.CSS_STYLE_CLASS_EDITOR_TITLE);
setMessage(JstUIMessages.CSS_STYLE_CLASS_EDITOR_DESCRIPTION);
}
+ composite.setLayout(new GridLayout());
- Split split = new Split(composite, SWT.VERTICAL);
+ // ===============================================================================
+ // Create split component that separates dialog on 2 parts
+ // ===============================================================================
+ split = new Split(composite, SWT.VERTICAL);
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- composite.setLayout(layout);
-
- // initialize browser container
+ // ===============================================================================
+ // Create browser container
+ // ===============================================================================
browserContainer = getCompositeElement(split);
+ // create browser component
createBrowserComponent();
- /* ============================================= */
+ // ===============================================================================
+ // Create down splitter container
+ // ===============================================================================
Composite downSplitPane = getCompositeElement(split);
Composite classComposite = new Composite(downSplitPane, SWT.BORDER);
- GridData gridData = new GridData(GridData.FILL, GridData.BEGINNING, true, false);
- classComposite.setLayoutData(gridData);
+ classComposite.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, false));
+ classComposite.setLayout(new GridLayout(3, false));
- final GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 3;
- classComposite.setLayout(gridLayout);
+ // ===============================================================================
+ // Create component that contains CSS file pass and it's selectors (style classes combo box)
+ // ===============================================================================
+ createCSSFilePathComponent(classComposite);
+ createStyleClassCombo(classComposite);
- Label label = new Label(classComposite, SWT.LEFT);
+ // ===============================================================================
+ // Create style composite component
+ // ===============================================================================
+ styleComposite = new StyleComposite(downSplitPane, styleAttributes, Constants.EMPTY);
+ styleComposite.addManualChangeStyleListener(new ManualChangeStyleListener() {
+ public void styleChanged(ChangeStyleEvent event) {
+ styleChanged = true;
+ if (currentClassStyle != null && !currentClassStyle.equals(Constants.EMPTY)
+ && currentFile != null && !currentFile.equals(Constants.EMPTY)) {
+ styleComposite.updateStyle();
+ cssModel.setCSS(currentClassStyle, styleAttributes);
+ applyButton.setEnabled(true);
+ }
+ }
+ });
+
+ // ===============================================================================
+ // Create custom button panel
+ // ===============================================================================
+ createCustomButtonPanel(downSplitPane);
+
+ styleAttributes.addChangeStyleListener(new ChangeStyleListener() {
+ public void styleChanged(ChangeStyleEvent event) {
+ if (!browser.isDisposed()) {
+ browser.setText(getTextForBrowser());
+ }
+ }
+ });
+
+ if (currentFile != null) {
+ initCSSModel(currentFile, true, true);
+ } else if (currentClassStyle != null) {
+ classCombo.setText(currentClassStyle);
+ styleAttributes.setCssSelector(currentClassStyle);
+ }
+
+ // 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));
+
+ return composite;
+ }
+
+ private void createCSSFilePathComponent(Composite parent) {
+ Label label = new Label(parent, SWT.LEFT);
label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false, false));
label.setText(JstUIMessages.CSS_CLASS_DIALOG_FILE_LABEL);
// Text field contains path to the CSS file
- text = new Text(classComposite, SWT.BORDER);
+ text = new Text(parent, SWT.BORDER);
text.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
text.setEditable(false);
text.addModifyListener(new ModifyListener() {
@@ -260,7 +324,7 @@
}
});
- Button button = new Button(classComposite, SWT.PUSH);
+ 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);
@@ -275,7 +339,9 @@
});
button.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
- IResource project = Util.getCurrentProject();
+ // TODO:
+// IResource project = Util.getCurrentProject();
+ IResource project = ResourcesPlugin.getWorkspace().getRoot();
ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(),
new WorkbenchLabelProvider(), new BaseWorkbenchContentProvider());
@@ -300,12 +366,14 @@
messageBox.setMessage("'" + currentFile + "' " + JstUIMessages.CSS_SAVE_DIALOG_MESSAGE); //$NON-NLS-1$ //$NON-NLS-2$
int result = messageBox.open();
if (result == SWT.YES) {
- saveChanges();
+ saveChanges(true);
} else {
styleComposite.closePreview(false);
updateStyleComposite();
}
}
+ styleComposite.revertPreview();
+
// open new CSS file and initialize dialog
boolean useRelativePath = true;
if (project instanceof IWorkspaceRoot) {
@@ -319,55 +387,62 @@
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());
}
}
}
});
-
- label = new Label(classComposite, SWT.LEFT);
+ }
+
+ /**
+ * This method is used to create and initialize style class comboBox component.
+ *
+ * @param parent Composite component
+ */
+ private void createStyleClassCombo(Composite parent) {
+ Label label = new Label(parent, SWT.LEFT);
label.setLayoutData(new GridData(GridData.END, GridData.CENTER, false, false));
label.setText(JstUIMessages.CSS_CLASS_DIALOG_STYLE_CLASS_LABEL);
- gridData = new GridData(GridData.FILL, GridData.CENTER, true, false);
+ GridData gridData = new GridData(GridData.FILL, GridData.CENTER, true, false);
gridData.horizontalSpan = 2;
- classCombo = new Combo(classComposite, SWT.BORDER);
+ classCombo = new Combo(parent, SWT.BORDER);
classCombo.setLayoutData(gridData);
classCombo.setEnabled(false);
+ // add selection listener
classCombo.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
- if (currentFile != null && !currentFile.equals(Constants.EMPTY)) {
- if (styleChanged) {
- if (currentClassStyle != null && !currentClassStyle.equals(Constants.EMPTY)) {
- styleComposite.updateStyle();
- cssModel.setCSS(currentClassStyle, styleAttributes);
- // update ComboBox element list
- int currentIndex = classCombo.indexOf(currentClassStyle);
- if (currentIndex == -1) {
- classCombo.add(currentClassStyle);
- }
- }
+ if (keyInputSelector) {
+ keyInputSelector = false;
+ if (currentClassStyle != null && classCombo.indexOf(currentClassStyle) != -1) {
+ return;
}
- // update current class style value
- currentClassStyle = classCombo.getText();
- updateStyleComposite();
- updateOKButtonState();
- } else {
- currentClassStyle = classCombo.getText();
- styleAttributes.setCssSelector(currentClassStyle);
}
+ cssStyleClassChanged();
+ applyButton.setEnabled(false);
+ keyInputSelector = false;
}
});
+ // add key modified listener
classCombo.addKeyListener(new KeyAdapter() {
- @Override
public void keyReleased(KeyEvent e) {
- // update current class style value
- currentClassStyle = classCombo.getText().trim();
- styleAttributes.setCssSelector(currentClassStyle);
- updateOKButtonState();
+ if (currentClassStyle != null && currentClassStyle.equals(classCombo.getText().trim())) {
+ return;
+ }
+ cssStyleClassChanged();
+ applyButton.setEnabled(true);
+ keyInputSelector = true;
}
+
});
+ // this listener is responsible for processing dialog header message events
classCombo.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
String cssClass = classCombo.getText().trim();
@@ -382,35 +457,36 @@
applyToStatusLine(status);
}
});
+ }
- /* ============================================ */
- styleAttributes.addChangeStyleListener(new ChangeStyleListener() {
- public void styleChanged(ChangeStyleEvent event) {
- if (!browser.isDisposed()) {
- browser.setText(getTextForBrowser());
- }
-// if (cssModel != null && currentClassStyle != null) {
-// classCombo.setToolTipText(cssModel.getCSSText(currentClassStyle));
-// }
- }
- });
- // create style composite component
- styleComposite = new StyleComposite(downSplitPane, styleAttributes, Constants.EMPTY);
- styleComposite.addManualChangeStyleListener(new ManualChangeStyleListener() {
- public void styleChanged(ChangeStyleEvent event) {
- styleChanged = true;
- if (currentClassStyle != null && !currentClassStyle.equals(Constants.EMPTY)
- && currentFile != null && !currentFile.equals(Constants.EMPTY)) {
- styleComposite.updateStyle();
- cssModel.setCSS(currentClassStyle, styleAttributes);
- }
+ /**
+ * This method is used to create custom button panel.
+ *
+ * @param parent Composite component
+ */
+ private void createCustomButtonPanel(Composite parent) {
+ Composite buttonComposite = new Composite(parent, SWT.NONE);
+ buttonComposite.setLayoutData(new GridData(GridData.END, GridData.BEGINNING, true, false));
+ buttonComposite.setLayout(new GridLayout());
+ // add APPLY button
+ applyButton = createCustomButton(buttonComposite, JstUIMessages.BUTTON_APPLY);
+ applyButton.setEnabled(false);
+ applyButton.setToolTipText(JstUIMessages.CSS_APPLY_CHANGES);
+ applyButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ if (currentClassStyle != null && !currentClassStyle.equals(Constants.EMPTY)) {
+ // update ComboBox element list
+ if (classCombo.indexOf(currentClassStyle) == -1) {
+ classCombo.add(currentClassStyle);
+ }
+ saveChanges(false);
+ applyButton.setEnabled(false);
+ styleChanged = false;
+ }
}
});
-
- // add clear button
- Button clearButton = new Button(downSplitPane, SWT.PUSH);
- clearButton.setText(JstUIMessages.BUTTON_CLEAR);
- clearButton.setLayoutData(new GridData(GridData.END, GridData.CENTER, false, false));
+ // add CLEAR button
+ Button clearButton = createCustomButton(buttonComposite, JstUIMessages.BUTTON_CLEAR);
clearButton.setToolTipText(JstUIMessages.CSS_CLEAR_STYLE_SHEET);
clearButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
@@ -420,19 +496,61 @@
styleChanged = true;
}
});
+ }
- if (currentFile != null) {
- initCSSModel(currentFile, true, true);
- } else if (currentClassStyle != null) {
- classCombo.setText(currentClassStyle);
- styleAttributes.setCssSelector(currentClassStyle);
- }
+ /**
+ * This method is used to create custom button.
+ *
+ * @param parent Composite component
+ * @param label Button label value
+ */
+ protected Button createCustomButton(Composite parent, String label) {
+ // increment the number of columns in the button bar
+ ((GridLayout) parent.getLayout()).numColumns++;
+ Button button = new Button(parent, SWT.PUSH);
+ button.setText(label);
+// setButtonLayoutData(button);
+ return button;
+ }
- split.setWeights(new int[]{15, 85});
- split.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, true));
+ /**
+ * Method is used to correctly process style class change operation.
+ */
+ private void cssStyleClassChanged() {
+ if (currentFile != null && !currentFile.equals(Constants.EMPTY)) {
+ if (styleChanged && currentClassStyle != null && !currentClassStyle.equals(Constants.EMPTY)) {
+ MessageBox messageBox = new MessageBox(getParentShell(), SWT.YES | SWT.NO | SWT.ICON_QUESTION);
+ messageBox.setText(JstUIMessages.CSS_SAVE_DIALOG_TITLE);
+ messageBox.setMessage("'" + currentFile + "' " + JstUIMessages.CSS_SAVE_DIALOG_MESSAGE); //$NON-NLS-1$ //$NON-NLS-2$
+ int result = messageBox.open();
+ if (result == SWT.YES) {
+ // update ComboBox element list
+ if (classCombo.indexOf(currentClassStyle) == -1) {
+ classCombo.add(currentClassStyle);
+ }
+ saveChanges(false);
+ // update content assist proposals
+ SimpleContentProposalProvider proposalProvider =
+ (SimpleContentProposalProvider)contentAssistAdapter.getContentProposalProvider();
+ proposalProvider.setProposals(classCombo.getItems());
+ } else {
+ cssModel.init(currentFile);
+ }
+ }
+ // update current class style value
+ currentClassStyle = classCombo.getText().trim();
+ styleComposite.revertPreview();
+ updateStyleComposite();
+ cssModel.setCSS(currentClassStyle, styleAttributes);
+ styleComposite.updatePreview();
- return composite;
- }
+ updateOKButtonState();
+ } else {
+ currentClassStyle = classCombo.getText().trim();
+ }
+ styleChanged = false;
+ styleAttributes.setCssSelector(currentClassStyle);
+ }
/**
* Initialize CSS model with active opened CSS file.
@@ -444,7 +562,7 @@
if (file != null) {
// create CSS Model
cssModel = new CSSModel(file);
- classCombo.setEnabled(true);
+ classCombo.setEnabled(true);
classCombo.removeAll();
// set file path to corresponding text field
if (useRelativePathPath) {
@@ -469,33 +587,16 @@
}
classCombo.setToolTipText(cssModel.getCSSText(currentClassStyle));
+ styleComposite.setShowPreviewTab(true);
// update style composite component with the values from new CSS file
if (updateCSSModel) {
updateStyleComposite();
}
- styleComposite.updatePreview(cssModel);
+ styleComposite.initPreview(cssModel);
}
}
/**
- * Method return the most serious error occurs on the page and that should be displayed.
- *
- * @return IStatus object
- */
- private IStatus findMostSevere() {
- if (filePathStatus.matches(IStatus.ERROR)) {
- return filePathStatus;
- }
- if (classNameStatus.matches(IStatus.ERROR)) {
- return classNameStatus;
- }
- if (filePathStatus.getSeverity() > classNameStatus.getSeverity()) {
- return filePathStatus;
- }
- else return classNameStatus;
- }
-
- /**
* This method takes affect to OK button when dialog is opened in "dialog" mode and not in "wizard".
* In case of "wizard" mode OK button is not available.
*/
@@ -511,13 +612,39 @@
}
/**
- * Method is used to create browser component to display preview html.
+ * Method is used to create browser component to display preview HTML.
*/
private void createBrowserComponent() {
GridData gridData = new GridData(GridData.FILL, GridData.FILL, true, true);
browser = new Browser(browserContainer, SWT.BORDER | SWT.MOZILLA);
browser.setText(getTextForBrowser());
- browser.addMouseListener(this);
+ browser.addMouseListener(new MouseAdapter() {
+ public void mouseDoubleClick(MouseEvent e) {
+ if (e.widget == browser) {
+ browser.removeMouseListener(this);
+ browser.dispose();
+ // create Text area component instead of HTML Browser
+ GridData gridData = new GridData(GridData.FILL, GridData.FILL, true, true);
+ textBrowser = new Text(browserContainer, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL);
+ textBrowser.setText(previewBrowserValue);
+ textBrowser.addFocusListener(new FocusAdapter() {
+ public void focusLost(FocusEvent e) {
+ if (e.widget == textBrowser) {
+ previewBrowserValue = textBrowser.getText();
+ textBrowser.dispose();
+ // create Browse component instead of text area
+ createBrowserComponent();
+ }
+ browserContainer.layout();
+ }
+ });
+ textBrowser.setLayoutData(gridData);
+ textBrowser.setEditable(true);
+ textBrowser.setFocus();
+ }
+ browserContainer.layout();
+ }
+ });
browser.setLayoutData(gridData);
}
@@ -526,7 +653,6 @@
*/
private void updateStyleComposite() {
String style = cssModel.getStyle(currentClassStyle);
-// classCombo.setToolTipText(cssModel.getCSSText(currentClassStyle));
styleComposite.recreateStyleComposite(style, currentClassStyle);
}
@@ -564,11 +690,13 @@
/**
* Method should be called in case of dialog closure operation.
*/
- public void saveChanges() {
+ public void saveChanges(boolean close) {
styleComposite.updateStyle();
cssModel.setCSS(currentClassStyle, styleAttributes);
cssModel.saveModel();
- styleComposite.closePreview(true);
+ if (close) {
+ styleComposite.closePreview(true);
+ }
}
/**
@@ -577,14 +705,7 @@
* @return selector name
*/
public String getSelectorName() {
- String className = currentClassStyle;
- if (currentClassStyle != null) {
- className = currentClassStyle.replaceAll("\\.", Constants.EMPTY); //$NON-NLS-1$
- className = className.replaceAll("\\,", Constants.EMPTY);
- className = className.replaceAll("\\s++", Constants.WHITE_SPACE); //$NON-NLS-1$
- }
-
- return className;
+ return Util.formatCSSSelectorToStyleClassView(currentClassStyle);
}
/**
@@ -616,7 +737,7 @@
int code = getReturnCode();
switch (code) {
case OK:
- saveChanges();
+ saveChanges(true);
break;
case CANCEL:
default:
@@ -625,58 +746,7 @@
}
return super.close();
}
-
- /**
- * @see org.eclipse.swt.events.MouseListener#mouseDoubleClick(org.eclipse.swt.events.MouseEvent)
- */
- public void mouseDoubleClick(MouseEvent e) {
- if (e.widget == browser) {
- browser.removeMouseListener(this);
- browser.dispose();
- // create Text area component instead of HTML Browser
- GridData gridData = new GridData(GridData.FILL, GridData.FILL, true, true);
- textBrowser = new Text(browserContainer, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL);
- textBrowser.setText(previewBrowserValue);
- textBrowser.addFocusListener(this);
- textBrowser.setLayoutData(gridData);
- textBrowser.setEditable(true);
- textBrowser.setFocus();
- }
- browserContainer.layout();
- }
- /**
- * @see org.eclipse.swt.events.FocusListener#focusLost(org.eclipse.swt.events.FocusEvent)
- */
- public void focusLost(FocusEvent e) {
- if (e.widget == textBrowser) {
- previewBrowserValue = textBrowser.getText();
- textBrowser.removeFocusListener(this);
- textBrowser.dispose();
- // create Browse component instead of text area
- createBrowserComponent();
- }
- browserContainer.layout();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.MouseListener#mouseDown(org.eclipse.swt.events.MouseEvent)
- */
- public void mouseDown(MouseEvent e) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.MouseListener#mouseUp(org.eclipse.swt.events.MouseEvent)
- */
- public void mouseUp(MouseEvent e) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.FocusListener#focusGained(org.eclipse.swt.events.FocusEvent)
- */
- public void focusGained(FocusEvent e) {
- }
-
/**
* Add MessageDialogListener object.
*
@@ -687,15 +757,6 @@
}
/**
- * Remove ManualChangeStyleListener object passed by parameter.
- *
- * @param listener ManualChangeStyleListener object to be removed
- */
- public void removeMessageDialogListener(MessageDialogListener listener) {
- errorListeners.remove(listener);
- }
-
- /**
* Method is used to notify all subscribed listeners about possible any errors on the page.
*/
private void notifyListeners(Object source, IStatus operationStatus) {
@@ -705,6 +766,24 @@
}
}
+ /**
+ * Method return the most serious error occurs on the page and that should be displayed.
+ *
+ * @return IStatus object
+ */
+ private IStatus findMostSevere() {
+ if (filePathStatus.matches(IStatus.ERROR)) {
+ return filePathStatus;
+ }
+ if (classNameStatus.matches(IStatus.ERROR)) {
+ return classNameStatus;
+ }
+ if (filePathStatus.getSeverity() > classNameStatus.getSeverity()) {
+ return filePathStatus;
+ }
+ else return classNameStatus;
+ }
+
/**
* Applies the status to the status line of a dialog page.
*/
@@ -726,11 +805,11 @@
case IStatus.INFO:
setErrorMessage(null);
setMessage(message, WizardPage.INFORMATION);
- break;
+ break;
default:
setErrorMessage(message);
setMessage(null);
- break;
+ break;
}
}
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSStyleDialog.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSStyleDialog.java 2008-12-01 17:12:48 UTC (rev 12178)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSStyleDialog.java 2008-12-01 17:12:50 UTC (rev 12179)
@@ -43,7 +43,7 @@
final static int MIN_HEIGHT_FOR_BROWSER = 60;
- private String previewBrowserValue = Constants.TEXT_FOR_PREVIEW;
+ private String previewBrowserValue = JstUIMessages.DEFAULT_TEXT_FOR_BROWSER_PREVIEW;
private Composite browserContainer = null;
private Browser browser = null;
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 2008-12-01 17:12:48 UTC (rev 12178)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/StyleComposite.java 2008-12-01 17:12:50 UTC (rev 12179)
@@ -53,7 +53,6 @@
private static String NODE_ATTRIBUTE_NAME = "name";
private static int TAB_TEXT_FONT_NUMBER = 0;
- private static int TAB_QUICK_EDIT_NUMBER = 5;
private static int FIRST_SELECTION = 0;
private static int SIZE_NULL = 0;
@@ -80,6 +79,8 @@
private HashMap<String, ArrayList<String>> comboMap = new HashMap<String, ArrayList<String>>();
private HashMap<String, ArrayList<String>> elementsMap = new HashMap<String, ArrayList<String>>();
+ private boolean showPreviewTab = false;
+
/**
* StyleComposite constructor.
*
@@ -200,10 +201,12 @@
tabPropertySheet.setToolTipText(JstUIMessages.PROPERTY_SHEET_TAB_NAME);
tabPropertySheet.setControl(createTabPropertySheetControl(tabFolder));
- tabPreview = new TabItem(tabFolder, SWT.NONE);
- tabPreview.setText(JstUIMessages.PREVIEW_SHEET_TAB_NAME);
- tabPreview.setToolTipText(JstUIMessages.PREVIEW_SHEET_TAB_NAME);
- tabPreview.setControl(createPreviewContol(tabFolder));
+ if (showPreviewTab) {
+ tabPreview = new TabItem(tabFolder, SWT.NONE);
+ tabPreview.setText(JstUIMessages.PREVIEW_SHEET_TAB_NAME);
+ tabPreview.setToolTipText(JstUIMessages.PREVIEW_SHEET_TAB_NAME);
+ tabPreview.setControl(createPreviewContol(tabFolder));
+ }
tabFolder.setSelection(TAB_TEXT_FONT_NUMBER);
@@ -212,7 +215,7 @@
tabQuickEdit.setText(JstUIMessages.QUICK_EDIT_TAB_NAME);
tabQuickEdit.setToolTipText(JstUIMessages.QUICK_EDIT_TAB_NAME);
tabQuickEdit.setControl(createTabQuickEditContol(tabFolder));
- tabFolder.setSelection(TAB_QUICK_EDIT_NUMBER);
+ tabFolder.setSelection(tabQuickEdit);
lastSelectedTab = tabQuickEdit;
}
@@ -406,7 +409,7 @@
tabQuickEditControl.updateData();
}
- tabFolder.setSelection(TAB_QUICK_EDIT_NUMBER);
+ tabFolder.setSelection(tabQuickEdit);
lastSelectedTab = tabQuickEdit;
} else {
if (tabQuickEdit != null && !tabQuickEdit.isDisposed()) {
@@ -421,13 +424,45 @@
*
* @param cssModel model associated with the file that should be displayed in preview tab
*/
- public void updatePreview(CSSModel cssModel) {
+ public void initPreview(CSSModel cssModel) {
+ if (showPreviewTab && ((tabPreview == null) || tabPreview.isDisposed())) {
+ tabPreview = new TabItem(tabFolder, SWT.NONE);
+ tabPreview.setText(JstUIMessages.PREVIEW_SHEET_TAB_NAME);
+ tabPreview.setToolTipText(JstUIMessages.PREVIEW_SHEET_TAB_NAME);
+ tabPreview.setControl(createPreviewContol(tabFolder));
+ }
if (tabPreviewControl != null) {
- tabPreviewControl.updatePreview(cssModel);
+ tabPreviewControl.initPreview(cssModel);
+ tabPreviewControl.selectEditorArea(styleAttributes.getCssSelector(), 0);
}
}
/**
+ * Method is used to update preview selection area.
+ */
+ public void updatePreview() {
+ if (tabPreviewControl != null) {
+ tabPreviewControl.selectEditorArea(styleAttributes.getCssSelector(), 0);
+ }
+ }
+
+ /**
+ * Method is used to revert preview to before-saved state.
+ */
+ public void revertPreview() {
+ if (showPreviewTab && ((tabPreview == null) || tabPreview.isDisposed())) {
+ tabPreview = new TabItem(tabFolder, SWT.NONE);
+ tabPreview.setText(JstUIMessages.PREVIEW_SHEET_TAB_NAME);
+ tabPreview.setToolTipText(JstUIMessages.PREVIEW_SHEET_TAB_NAME);
+ tabPreview.setControl(createPreviewContol(tabFolder));
+ }
+ if (tabPreviewControl != null) {
+ tabPreviewControl.doRevertToSaved();
+ tabPreviewControl.selectEditorArea(styleAttributes.getCssSelector(), 0);
+ }
+ }
+
+ /**
* Method is used to close preview tab correctly.
*
* @param save close editor with saving or not
@@ -438,6 +473,20 @@
}
}
+ /**
+ * @param showPreviewTab the showPreviewTab to set
+ */
+ public void setShowPreviewTab(boolean showPreviewTab) {
+ this.showPreviewTab = showPreviewTab;
+ }
+
+ /**
+ * @return the showPreviewTab
+ */
+ public boolean isShowPreviewTab() {
+ return showPreviewTab;
+ }
+
/**
* Add ManualChangeStyleListener object.
*
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSModel.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSModel.java 2008-12-01 17:12:48 UTC (rev 12178)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSModel.java 2008-12-01 17:12:50 UTC (rev 12179)
@@ -56,9 +56,15 @@
* @param styleFile CSS style class that should initialize CSS model
*/
public CSSModel(IFile styleFile) {
+ init(styleFile);
+ }
+
+ public void init(IFile styleFile) {
try {
this.styleFile = styleFile;
-
+ if (model != null) {
+ releaseModel();
+ }
formatProcessorCSS = new FormatProcessorCSS();
IModelManager modelManager = StructuredModelManager.getModelManager();
model = modelManager.getModelForEdit(styleFile);
@@ -196,9 +202,15 @@
// set properties
Set<Entry<String, String>> set = styleAttributes.entrySet();
for (Map.Entry<String, String> me : set) {
- declaration.setProperty(me.getKey(), me.getValue(), Constants.EMPTY);
+ try {
+ declaration.setProperty(me.getKey(), me.getValue(), Constants.EMPTY);
+ } catch (Exception e) {
+// declaration.removeProperty(me.getKey());
+// e.printStackTrace();
+ }
}
+ formatProcessorCSS.formatModel(model);
return;
}
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/Constants.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/Constants.java 2008-12-01 17:12:48 UTC (rev 12178)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/Constants.java 2008-12-01 17:12:50 UTC (rev 12179)
@@ -76,6 +76,4 @@
public static String CLOSE_SPAN_TAG = "</span>";
public static String OPEN_DIV_TAG = "<div style=\"width: 100%;";
public static String CLOSE_DIV_TAG = "</div>";
-
- public static String TEXT_FOR_PREVIEW = "Double click to edit preview.";
}
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/Util.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/Util.java 2008-12-01 17:12:48 UTC (rev 12178)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/Util.java 2008-12-01 17:12:50 UTC (rev 12179)
@@ -382,4 +382,48 @@
}
return null;
}
+
+ /**
+ * Method is used to convert style class value to its CSS file view presentation.
+ * Example: class="value1, value2, value3" => ".value1 .value2 .value3"
+ *
+ * @param styleClass the value of class attribute
+ * @return style class presentation in CSS file
+ */
+ public static String formatStyleClassToCSSView (String styleClass) {
+ if (styleClass != null && !styleClass.equals(Constants.EMPTY)) {
+ String[] styleClasses = styleClass.split("\\s++"); //$NON-NLS-1$
+ StringBuffer sb = new StringBuffer();
+ for (int i = 0; i < styleClasses.length; i++) {
+ String value = styleClasses[i];
+ // check if first symbol doesn't specify some special CSS symbols
+ if (!value.startsWith("#")) { //$NON-NLS-1$
+ sb.append("."); //$NON-NLS-1$
+ }
+ sb.append(value);
+ if (i != (styleClasses.length - 1)) {
+ sb.append(Constants.WHITE_SPACE);
+ }
+ }
+ return sb.toString().trim();
+ }
+ return null;
+ }
+
+ /**
+ * This method is handle input parameter in reverse way as <code>formatStyleClassToCSSView</code> method.
+ * Example: ".value1 .value2 .value3" => "value1, value2, value3"
+ *
+ * @return String value
+ */
+ public static String formatCSSSelectorToStyleClassView(String cssSelector) {
+ String className = cssSelector;
+ if (cssSelector != null) {
+ className = cssSelector.replaceAll("\\.", Constants.EMPTY); //$NON-NLS-1$
+ className = className.replaceAll("\\,", Constants.EMPTY); //$NON-NLS-1$
+ className = className.replaceAll("\\s++", Constants.WHITE_SPACE); //$NON-NLS-1$
+ }
+
+ return className;
+ }
}
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabBackgroundControl.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabBackgroundControl.java 2008-12-01 17:12:48 UTC (rev 12178)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabBackgroundControl.java 2008-12-01 17:12:50 UTC (rev 12179)
@@ -235,24 +235,29 @@
*/
public void updateData(boolean param) {
updateDataFromStyleAttributes = true;
- String tmp;
// set BACKGROUND_COLOR attribute
- if ((tmp = styleAttributes.getAttribute(CSSConstants.BACKGROUND_COLOR)) != null) {
+ String tmp = styleAttributes.getAttribute(CSSConstants.BACKGROUND_COLOR);
+ if (tmp == null) {
+ tmp = Constants.EMPTY;
+ }
+ if (!tmp.equals(colorCombo.getText())) {
colorCombo.setText(tmp);
- } else {
- colorCombo.setText(Constants.EMPTY);
}
// set BACKGROUND_IMAGE attribute
- if ((tmp = styleAttributes.getAttribute(CSSConstants.BACKGROUND_IMAGE)) != null) {
+ tmp = styleAttributes.getAttribute(CSSConstants.BACKGROUND_IMAGE);
+ if (tmp == null) {
+ tmp = Constants.EMPTY;
+ }
+ if (!tmp.equals(backgroundImageCombo.getText())) {
backgroundImageCombo.setText(tmp);
- } else {
- backgroundImageCombo.setText(Constants.EMPTY);
}
// set BACKGROUND_REPEAT attribute
- if ((tmp = styleAttributes.getAttribute(CSSConstants.BACKGROUND_REPEAT)) != null) {
+ tmp = styleAttributes.getAttribute(CSSConstants.BACKGROUND_REPEAT);
+ if (tmp == null) {
+ tmp = Constants.EMPTY;
+ }
+ if (!tmp.equals(backgroundRepeatCombo.getText())) {
backgroundRepeatCombo.setText(tmp);
- } else {
- backgroundRepeatCombo.setText(Constants.EMPTY);
}
updateDataFromStyleAttributes = false;
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabBoxesControl.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabBoxesControl.java 2008-12-01 17:12:48 UTC (rev 12178)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabBoxesControl.java 2008-12-01 17:12:50 UTC (rev 12179)
@@ -10,9 +10,14 @@
******************************************************************************/
package org.jboss.tools.jst.jsp.outline.cssdialog.tabs;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import java.util.Map.Entry;
+
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.JFaceResources;
-
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
@@ -30,7 +35,6 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
-
import org.jboss.tools.jst.jsp.JspEditorPlugin;
import org.jboss.tools.jst.jsp.messages.JstUIMessages;
import org.jboss.tools.jst.jsp.outline.cssdialog.common.CSSConstants;
@@ -42,13 +46,7 @@
import org.jboss.tools.jst.jsp.outline.cssdialog.events.StyleAttributes;
import org.jboss.tools.jst.jsp.outline.cssdialog.parsers.ColorParser;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-
/**
* Class for creating control in Box tab
*
@@ -468,10 +466,14 @@
*/
public void updateData(boolean param) {
updateDataFromStyleAttributes = true;
- String tmp;
// set WIDTH and EXTENSION_WIDTH attributes
- if ((tmp = styleAttributes.getAttribute(CSSConstants.WIDTH)) != null) {
- String[] str = Util.convertExtString(tmp);
+ String tmp = styleAttributes.getAttribute(CSSConstants.WIDTH);
+ if (tmp == null) {
+ tmp = Constants.EMPTY;
+ extWidthCombo.select(0);
+ }
+ String[] str = Util.convertExtString(tmp);
+ if (!str[0].equals(widthText.getText())) {
widthText.setText(str[0]);
if (extWidthCombo.indexOf(str[1]) != -1) {
extWidthCombo.setText(str[1]);
@@ -479,81 +481,86 @@
} else {
extWidthCombo.select(0);
}
- } else {
- widthText.setText(Constants.EMPTY);
- extWidthCombo.select(0);
}
// set HEIGHT and EXTENSION_HEIGHT attributes
- if ((tmp = styleAttributes.getAttribute(CSSConstants.HEIGHT)) != null) {
- String[] str = Util.convertExtString(tmp);
- heightText.setText(str[0]);
-
+ tmp = styleAttributes.getAttribute(CSSConstants.HEIGHT);
+ if (tmp == null) {
+ tmp = Constants.EMPTY;
+ extHeightCombo.select(0);
+ }
+ str = Util.convertExtString(tmp);
+ if (!str[0].equals(heightText.getText())) {
+ heightText.setText(str[0]);
if (extHeightCombo.indexOf(str[1]) != -1) {
- extHeightCombo.setText(str[1]);
- extHeightCombo.select(extHeightCombo.indexOf(str[1]));
+ extHeightCombo.setText(str[1]);
+ extHeightCombo.select(extHeightCombo.indexOf(str[1]));
} else {
- extHeightCombo.select(0);
+ extHeightCombo.select(0);
}
- } else {
- heightText.setText(Constants.EMPTY);
- extHeightCombo.select(0);
}
// set BORDER_STYLE attribute
- if ((tmp = styleAttributes.getAttribute(CSSConstants.BORDER_STYLE)) != null) {
- borderStyleCombo.setText(tmp);
- } else {
- borderStyleCombo.setText(Constants.EMPTY);
+ tmp = styleAttributes.getAttribute(CSSConstants.BORDER_STYLE);
+ if (tmp == null) {
+ tmp = Constants.EMPTY;
}
+ if (!tmp.equals(borderStyleCombo.getText())) {
+ borderStyleCombo.setText(tmp);
+ }
// set BORDER_COLOR attribute
- if ((tmp = styleAttributes.getAttribute(CSSConstants.BORDER_COLOR)) != null) {
- borderColorCombo.setText(tmp);
- } else {
- borderColorCombo.setText(Constants.EMPTY);
+ tmp = styleAttributes.getAttribute(CSSConstants.BORDER_COLOR);
+ if (tmp == null) {
+ tmp = Constants.EMPTY;
}
+ if (!tmp.equals(borderColorCombo.getText())) {
+ borderColorCombo.setText(tmp);
+ }
// set BORDER_WIDTH and EXTENSION_BORDER_WIDTH attributes
- if ((tmp = styleAttributes.getAttribute(CSSConstants.BORDER_WIDTH)) != null) {
- String[] str = Util.convertExtString(tmp);
- borderWidthCombo.setText(str[0]);
-
+ tmp = styleAttributes.getAttribute(CSSConstants.BORDER_WIDTH);
+ if (tmp == null) {
+ tmp = Constants.EMPTY;
+ extBorderWidthCombo.select(0);
+ }
+ str = Util.convertExtString(tmp);
+ if (!str[0].equals(borderWidthCombo.getText())) {
+ borderWidthCombo.setText(str[0]);
if (extBorderWidthCombo.indexOf(str[1]) != -1) {
- extBorderWidthCombo.setText(str[1]);
- extBorderWidthCombo.select(extBorderWidthCombo.indexOf(str[1]));
+ extBorderWidthCombo.setText(str[1]);
+ extBorderWidthCombo.select(extBorderWidthCombo.indexOf(str[1]));
} else {
- extBorderWidthCombo.select(0);
+ extBorderWidthCombo.select(0);
}
- } else {
- borderWidthCombo.setText(Constants.EMPTY);
- extBorderWidthCombo.select(0);
}
// set MARGIN and EXTENSION_MARGIN attributes
- if ((tmp = styleAttributes.getAttribute(CSSConstants.MARGIN)) != null) {
- String[] str = Util.convertExtString(tmp);
- marginText.setText(str[0]);
-
+ tmp = styleAttributes.getAttribute(CSSConstants.MARGIN);
+ if (tmp == null) {
+ tmp = Constants.EMPTY;
+ extMarginCombo.select(0);
+ }
+ str = Util.convertExtString(tmp);
+ if (!str[0].equals(marginText.getText())) {
+ marginText.setText(str[0]);
if (extMarginCombo.indexOf(str[1]) != -1) {
- extMarginCombo.setText(str[1]);
- extMarginCombo.select(extMarginCombo.indexOf(str[1]));
+ extMarginCombo.setText(str[1]);
+ extMarginCombo.select(extMarginCombo.indexOf(str[1]));
} else {
- extMarginCombo.select(0);
+ extMarginCombo.select(0);
}
- } else {
- marginText.setText(Constants.EMPTY);
- extMarginCombo.select(0);
}
// set PADDING and EXTENSION_PADDING attributes
- if ((tmp = styleAttributes.getAttribute(CSSConstants.PADDING)) != null) {
- String[] str = Util.convertExtString(tmp);
- paddingText.setText(str[0]);
-
+ tmp = styleAttributes.getAttribute(CSSConstants.PADDING);
+ if (tmp == null) {
+ tmp = Constants.EMPTY;
+ extPaddingCombo.select(0);
+ }
+ str = Util.convertExtString(tmp);
+ if (!str[0].equals(paddingText.getText())) {
+ paddingText.setText(str[0]);
if (extPaddingCombo.indexOf(str[1]) != -1) {
- extPaddingCombo.setText(str[1]);
- extPaddingCombo.select(extPaddingCombo.indexOf(str[1]));
+ extPaddingCombo.setText(str[1]);
+ extPaddingCombo.select(extPaddingCombo.indexOf(str[1]));
} else {
- extPaddingCombo.select(0);
+ extPaddingCombo.select(0);
}
- } else {
- paddingText.setText(Constants.EMPTY);
- extPaddingCombo.select(0);
}
updateDataFromStyleAttributes = false;
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabPreviewControl.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabPreviewControl.java 2008-12-01 17:12:48 UTC (rev 12178)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabPreviewControl.java 2008-12-01 17:12:50 UTC (rev 12179)
@@ -58,7 +58,7 @@
*
* @param cssFile CSS file to be displayed in preview area
*/
- public void updatePreview(CSSModel cssModel) {
+ public void initPreview(CSSModel cssModel) {
this.cssModel = cssModel;
if (cssModel != null) {
IEditorInput input = new FileEditorInput(cssModel.getStyleFile());
@@ -75,6 +75,10 @@
for (Control control : getChildren()) {
control.dispose();
}
+ if (editor != null) {
+ editor.doRevertToSaved();
+ editor.close(false);
+ }
editor = (StructuredTextEditor)ref.getEditor(true);
editor.createPartControl(this);
editor.getTextViewer().setEditable(false);
@@ -87,6 +91,12 @@
}
}
+ public void doRevertToSaved() {
+ if (editor != null) {
+ editor.doRevertToSaved();
+ }
+ }
+
/**
* Method is used to select area that corresponds to specific selector.
*
@@ -95,9 +105,11 @@
* then index is serial number of this selector
*/
public void selectEditorArea(String selector, int index) {
- IndexedRegion indexedRegion = cssModel.getSelectorRegion(selector, index);
- if (editor != null && indexedRegion != null) {
- editor.selectAndReveal(indexedRegion.getStartOffset(), indexedRegion.getLength());
+ if (cssModel != null) {
+ IndexedRegion indexedRegion = cssModel.getSelectorRegion(selector, index);
+ if (editor != null && indexedRegion != null) {
+ editor.selectAndReveal(indexedRegion.getStartOffset(), indexedRegion.getLength());
+ }
}
}
@@ -110,6 +122,7 @@
if (editor != null) {
editor.doRevertToSaved();
editor.close(save);
+ editor = null;
}
if (cssModel != null) {
cssModel.releaseModel();
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabPropertySheetControl.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabPropertySheetControl.java 2008-12-01 17:12:48 UTC (rev 12178)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabPropertySheetControl.java 2008-12-01 17:12:50 UTC (rev 12179)
@@ -65,7 +65,7 @@
for (String str : set) {
TreeItem item = new TreeItem(tree, SWT.NONE);
item.setText(str);
- item.setFont(Constants.FIRST_COLUMN, JFaceResources.getFontRegistry().get(JFaceResources.TEXT_FONT));
+// item.setFont(Constants.FIRST_COLUMN, JFaceResources.getFontRegistry().get(JFaceResources.TEXT_FONT));
ArrayList<String> list = elementMap.get(str);
for (String strList : list) {
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabTextControl.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabTextControl.java 2008-12-01 17:12:48 UTC (rev 12178)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabTextControl.java 2008-12-01 17:12:50 UTC (rev 12179)
@@ -397,58 +397,70 @@
*/
public void updateData(boolean param) {
updateDataFromStyleAttributes = true;
- String tmp;
// set FONT_FAMILY attribute
- if ((tmp = styleAttributes.getAttribute(CSSConstants.FONT_FAMILY)) != null) {
- fontFamilyText.setText(tmp);
- } else {
- fontFamilyText.setText(Constants.EMPTY);
+ String tmp = styleAttributes.getAttribute(CSSConstants.FONT_FAMILY);
+ if (tmp == null) {
+ tmp = Constants.EMPTY;
}
+ if (!tmp.equals(fontFamilyText.getText())) {
+ fontFamilyText.setText(tmp);
+ }
// set COLOR attribute
- if ((tmp = styleAttributes.getAttribute(CSSConstants.COLOR)) != null) {
- colorCombo.setText(tmp);
- } else {
- colorCombo.setText(Constants.EMPTY);
+ tmp = styleAttributes.getAttribute(CSSConstants.COLOR);
+ if (tmp == null) {
+ tmp = Constants.EMPTY;
}
+ if (!tmp.equals(colorCombo.getText())) {
+ colorCombo.setText(tmp);
+ }
// set FONT_SIZE and EXTENSION_FONT_SIZE attributes
- if ((tmp = styleAttributes.getAttribute(CSSConstants.FONT_SIZE)) != null) {
- String[] str = Util.convertExtString(tmp);
- fontSizeCombo.setText(str[0]);
-
+ tmp = styleAttributes.getAttribute(CSSConstants.FONT_SIZE);
+ if (tmp == null) {
+ tmp = Constants.EMPTY;
+ extFontSizeCombo.select(0);
+ }
+ String[] str = Util.convertExtString(tmp);
+ if (!str[0].equals(fontSizeCombo.getText())) {
+ fontSizeCombo.setText(str[0]);
if (extFontSizeCombo.indexOf(str[1]) != -1) {
- extFontSizeCombo.setText(str[1]);
- extFontSizeCombo.select(extFontSizeCombo.indexOf(str[1]));
+ extFontSizeCombo.setText(str[1]);
+ extFontSizeCombo.select(extFontSizeCombo.indexOf(str[1]));
} else {
- extFontSizeCombo.select(0);
+ extFontSizeCombo.select(0);
}
- } else {
- fontSizeCombo.setText(Constants.EMPTY);
- extFontSizeCombo.select(0);
}
// set TEXT_DECORATION attribute
- if ((tmp = styleAttributes.getAttribute(CSSConstants.TEXT_DECORATION)) != null) {
- textDecorationCombo.setText(tmp);
- } else {
- textDecorationCombo.setText(Constants.EMPTY);
+ tmp = styleAttributes.getAttribute(CSSConstants.TEXT_DECORATION);
+ if (tmp == null) {
+ tmp = Constants.EMPTY;
}
+ if (!tmp.equals(textDecorationCombo.getText())) {
+ textDecorationCombo.setText(tmp);
+ }
// set FONT_STYLE attribute
- if ((tmp = styleAttributes.getAttribute(CSSConstants.FONT_STYLE)) != null) {
- fontStyleCombo.setText(tmp);
- } else {
- fontStyleCombo.setText(Constants.EMPTY);
+ tmp = styleAttributes.getAttribute(CSSConstants.FONT_STYLE);
+ if (tmp == null) {
+ tmp = Constants.EMPTY;
}
+ if (!tmp.equals(fontStyleCombo.getText())) {
+ fontStyleCombo.setText(tmp);
+ }
// set FONT_WEIGHT attribute
- if ((tmp = styleAttributes.getAttribute(CSSConstants.FONT_WEIGHT)) != null) {
- fontWeigthCombo.setText(tmp);
- } else {
- fontWeigthCombo.setText(Constants.EMPTY);
+ tmp = styleAttributes.getAttribute(CSSConstants.FONT_WEIGHT);
+ if (tmp == null) {
+ tmp = Constants.EMPTY;
}
+ if (!tmp.equals(fontWeigthCombo.getText())) {
+ fontWeigthCombo.setText(tmp);
+ }
// set TEXT_ALIGN attribute
- if ((tmp = styleAttributes.getAttribute(CSSConstants.TEXT_ALIGN)) != null) {
- textAlignCombo.setText(tmp);
- } else {
- textAlignCombo.setText(Constants.EMPTY);
+ tmp = styleAttributes.getAttribute(CSSConstants.TEXT_ALIGN);
+ if (tmp == null) {
+ tmp = Constants.EMPTY;
}
+ if (!tmp.equals(textAlignCombo.getText())) {
+ textAlignCombo.setText(tmp);
+ }
updateDataFromStyleAttributes = false;
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/css/NewCSSClassWizard.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/css/NewCSSClassWizard.java 2008-12-01 17:12:48 UTC (rev 12178)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/css/NewCSSClassWizard.java 2008-12-01 17:12:50 UTC (rev 12179)
@@ -145,7 +145,7 @@
* Save page model.
*/
public void saveChanges() {
- dialog.saveChanges();
+ dialog.saveChanges(true);
}
/**
15 years, 5 months
JBoss Tools SVN: r12178 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-12-01 12:12:48 -0500 (Mon, 01 Dec 2008)
New Revision: 12178
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3326
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java 2008-12-01 16:44:31 UTC (rev 12177)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java 2008-12-01 17:12:48 UTC (rev 12178)
@@ -244,11 +244,10 @@
try {
uri = new URI(resolvedValue);
} catch (URISyntaxException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
}
- if (uri.isAbsolute() || (new File(resolvedValue)).exists())
+ if ((uri != null)
+ && (uri.isAbsolute() || (new File(resolvedValue)).exists()))
return resolvedValue;
return Constants.FILE_PREFIX+FileUtil.getFile(resolvedValue, file).getLocation().toOSString();
15 years, 5 months
JBoss Tools SVN: r12177 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2008-12-01 11:44:31 -0500 (Mon, 01 Dec 2008)
New Revision: 12177
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesFileUploadTemplate.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2921, additional css classes were added.
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesFileUploadTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesFileUploadTemplate.java 2008-12-01 16:41:50 UTC (rev 12176)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesFileUploadTemplate.java 2008-12-01 16:44:31 UTC (rev 12177)
@@ -10,6 +10,7 @@
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.Constants;
import org.jboss.tools.vpe.editor.util.HTML;
import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
import org.mozilla.interfaces.nsIDOMDocument;
@@ -104,70 +105,59 @@
labelDiv.appendChild(visualDocument.createTextNode(this.addControlLabel));
fileuploadButtonDiv.appendChild(labelDiv);
-
-
rootDiv.appendChild(table);
rootDiv.appendChild(createPanelDiv(pageContext, source, visualDocument, styleClasses));
table.appendChild(tr);
tr.appendChild(td);
td.appendChild(buttonBorderDiv);
buttonBorderDiv.appendChild(fileuploadButtonDiv);
- td.appendChild(createControl(pageContext, sourceNode, visualDocument, styleClasses.getUploadButtonClass2(),
- uploadControlLabel, false, styleClasses));
- td.appendChild(createControl(pageContext, sourceNode, visualDocument, styleClasses.getClearAllButtonClass2(),
- clearAllControlLabel, true , styleClasses));
+ td.appendChild(createControl(pageContext, sourceNode, visualDocument, styleClasses.getUploadButtonClass(),
+ styleClasses.getUploadButtonClass2(), uploadControlLabel, false, styleClasses));
+ td.appendChild(createControl(pageContext, sourceNode, visualDocument, styleClasses.getCleanButtonClass(),
+ styleClasses.getCleanButtonClass2(), clearAllControlLabel, true , styleClasses));
-
-// DOMTreeDumper dumper = new DOMTreeDumper();
-// dumper.dumpToStream(System.err, rootDiv);
-
data = new VpeCreationData(rootDiv);
return data;
}
+
/**
- * @param pageContext
- * @param sourceNode
- * @param visualDocument
- * @return
+ * Creates the control.
+ *
+ * @param pageContext the page context
+ * @param sourceNode the source node
+ * @param visualDocument the visual document
+ * @param secondCssClass the second css class
+ * @param thirdCssClass the third css class
+ * @param text the text
+ * @param isClearButton the is clear button
+ * @param styleClasses the style classes
+ *
+ * @return the ns idom node
*/
private nsIDOMNode createControl(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument,
- String secondCssClass,String text,boolean isClearButton, StyleClasses styleClasses) {
- //<div class="rich-fileupload-button-border" style="float: left;">
+ String secondCssClass, String thirdCssClass,String text,boolean isClearButton, StyleClasses styleClasses) {
+
final nsIDOMElement firstDiv = visualDocument.createElement(HTML.TAG_DIV);
+ final nsIDOMElement secondDiv = visualDocument.createElement(HTML.TAG_DIV);
+ final nsIDOMElement thirdDiv = visualDocument.createElement(HTML.TAG_DIV);
firstDiv.setAttribute(HTML.ATTR_CLASS, "rich-fileupload-button-border"); //$NON-NLS-1$
-
firstDiv.setAttribute(HTML.ATTR_STYLE,"float: "+(isClearButton ? "right;" : "left;")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- final nsIDOMElement secondDiv = visualDocument.createElement(HTML.TAG_DIV);
+ secondDiv.setAttribute(HTML.ATTR_CLASS, secondCssClass);
+ thirdDiv.setAttribute(HTML.ATTR_CLASS, thirdCssClass);
+
+ firstDiv.appendChild(secondDiv);
+ secondDiv.appendChild(thirdDiv);
if (isClearButton) {
- secondDiv.setAttribute(HTML.ATTR_CLASS, "rich-fileupload-button rich-fileupload-font"); //$NON-NLS-1$
- final nsIDOMElement thirdDiv = visualDocument.createElement(HTML.TAG_DIV);
- final nsIDOMElement aElement = visualDocument.createElement(HTML.TAG_A);
-
- aElement.setAttribute(HTML.ATTR_CLASS, "rich-fileupload-button-selection"); //$NON-NLS-1$
- thirdDiv.setAttribute(HTML.ATTR_CLASS, styleClasses.getClearAllButtonClass2());
- firstDiv.appendChild(secondDiv);
- secondDiv.appendChild(aElement);
- aElement.appendChild(thirdDiv);
thirdDiv.appendChild(visualDocument.createTextNode(text));
}else{
- secondDiv.setAttribute(HTML.ATTR_CLASS, secondCssClass);
-
final nsIDOMElement bDiv = visualDocument.createElement(HTML.TAG_B);
-
+ thirdDiv.appendChild(bDiv);
bDiv.appendChild(visualDocument.createTextNode(text));
-
- firstDiv.appendChild(secondDiv);
- secondDiv.appendChild(bDiv);
}
-
-
-
-
-
return firstDiv;
}
@@ -245,20 +235,36 @@
class StyleClasses {
- private String addButtonClass = "rich-fileupload-button rich-fileupload-font"; //$NON-NLS-1$
+ private String addButtonClass = "rich-fileupload-button rich-fileupload-font"; //$NON-NLS-1$
private String uploadButtonClass = "rich-fileupload-button rich-fileupload-font"; //$NON-NLS-1$
+ private String cleanButtonClass = "rich-fileupload-button rich-fileupload-font"; //$NON-NLS-1$
private String addButtonClassDiv2 = " rich-fileupload-button-content rich-fileupload-font rich-fileupload-ico rich-fileupload-ico-add"; //$NON-NLS-1$
- private String clearAllButtonClass2 = "rich-fileupload-button-content rich-fileupload-font rich-fileupload-ico rich-fileupload-ico-clear"; //$NON-NLS-1$
private String uploadButtonClass2 = "rich-fileupload-button-content rich-fileupload-font rich-fileupload-ico rich-fileupload-ico-start "; //$NON-NLS-1$
+ private String cleanButtonClass2 = "rich-fileupload-button-content rich-fileupload-font rich-fileupload-ico rich-fileupload-ico-clear"; //$NON-NLS-1$
private String uploadListClass = "rich-fileupload-list-overflow"; //$NON-NLS-1$
public StyleClasses(final Element sourceElement) {
- final String addButtonClass = sourceElement.getAttribute("addButtonClass"); //$NON-NLS-1$
+
+ final String addButtonClass = sourceElement.getAttribute("addButtonClass"); //$NON-NLS-1$
if (ComponentUtil.isNotBlank(addButtonClass)) {
this.addButtonClass += HTML.VALUE_CLASS_DELIMITER + addButtonClass;
- this.addButtonClassDiv2 += addButtonClassDiv2 + HTML.VALUE_CLASS_DELIMITER + addButtonClass;
+ this.addButtonClassDiv2 += HTML.VALUE_CLASS_DELIMITER + addButtonClass;
}
+
+ final String uploadButtonClass = sourceElement.getAttribute("uploadButtonClass"); //$NON-NLS-1$
+
+ if (ComponentUtil.isNotBlank(uploadButtonClass)) {
+ this.uploadButtonClass += HTML.VALUE_CLASS_DELIMITER + uploadButtonClass;
+ this.uploadButtonClass2 += HTML.VALUE_CLASS_DELIMITER + uploadButtonClass;
+ }
+
+ final String cleanButtonClass = sourceElement.getAttribute("cleanButtonClass"); //$NON-NLS-1$
+
+ if (ComponentUtil.isNotBlank(cleanButtonClass)) {
+ this.cleanButtonClass += HTML.VALUE_CLASS_DELIMITER + cleanButtonClass;
+ this.cleanButtonClass2 += HTML.VALUE_CLASS_DELIMITER + cleanButtonClass;
+ }
final String uploadListClass = sourceElement.getAttribute("uploadListClass"); //$NON-NLS-1$
@@ -280,13 +286,17 @@
public String getUploadButtonClass() {
return uploadButtonClass;
}
+
+ public String getCleanButtonClass() {
+ return cleanButtonClass;
+ }
public String getAddButtonClassDiv2() {
return addButtonClassDiv2;
}
- public String getClearAllButtonClass2() {
- return clearAllButtonClass2;
+ public String getCleanButtonClass2() {
+ return cleanButtonClass2;
}
public String getUploadButtonClass2() {
15 years, 5 months
JBoss Tools SVN: r12176 - trunk/as/features/org.jboss.ide.eclipse.as.test.feature.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2008-12-01 11:41:50 -0500 (Mon, 01 Dec 2008)
New Revision: 12176
Modified:
trunk/as/features/org.jboss.ide.eclipse.as.test.feature/feature.xml
Log:
[JBIDE-3325] include missing jmx.core.test plugin in test feature so it'll be fetched & built
Modified: trunk/as/features/org.jboss.ide.eclipse.as.test.feature/feature.xml
===================================================================
--- trunk/as/features/org.jboss.ide.eclipse.as.test.feature/feature.xml 2008-12-01 16:39:42 UTC (rev 12175)
+++ trunk/as/features/org.jboss.ide.eclipse.as.test.feature/feature.xml 2008-12-01 16:41:50 UTC (rev 12176)
@@ -426,4 +426,10 @@
install-size="0"
version="0.0.0"/>
+ <plugin
+ id="org.jboss.tools.jmx.core.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
</feature>
15 years, 5 months
JBoss Tools SVN: r12175 - trunk/tests/features/org.jboss.tools.test.feature.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2008-12-01 11:39:42 -0500 (Mon, 01 Dec 2008)
New Revision: 12175
Modified:
trunk/tests/features/org.jboss.tools.test.feature/feature.xml
Log:
[JBIDE-3325] [revert] include missing jmx.core and jmx.ui tests in tests feature so they'll be fetched & built (should be in org.jboss.ide.eclipse.as.test's feature)
Modified: trunk/tests/features/org.jboss.tools.test.feature/feature.xml
===================================================================
--- trunk/tests/features/org.jboss.tools.test.feature/feature.xml 2008-12-01 16:34:01 UTC (rev 12174)
+++ trunk/tests/features/org.jboss.tools.test.feature/feature.xml 2008-12-01 16:39:42 UTC (rev 12175)
@@ -272,18 +272,6 @@
version="0.0.0"/>
<plugin
- id="org.jboss.tools.jmx.core.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.jmx.ui.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
id="org.jboss.tools.vpe.test"
download-size="0"
install-size="0"
15 years, 5 months
JBoss Tools SVN: r12174 - trunk/tests/features/org.jboss.tools.test.feature.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2008-12-01 11:34:01 -0500 (Mon, 01 Dec 2008)
New Revision: 12174
Modified:
trunk/tests/features/org.jboss.tools.test.feature/feature.xml
Log:
include missing jmx.core and jmx.ui tests in tests feature so they'll be fetched & built
Modified: trunk/tests/features/org.jboss.tools.test.feature/feature.xml
===================================================================
--- trunk/tests/features/org.jboss.tools.test.feature/feature.xml 2008-12-01 15:51:20 UTC (rev 12173)
+++ trunk/tests/features/org.jboss.tools.test.feature/feature.xml 2008-12-01 16:34:01 UTC (rev 12174)
@@ -272,6 +272,18 @@
version="0.0.0"/>
<plugin
+ id="org.jboss.tools.jmx.core.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.jmx.ui.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
id="org.jboss.tools.vpe.test"
download-size="0"
install-size="0"
15 years, 5 months
JBoss Tools SVN: r12173 - in trunk/birt/features: org.jboss.tools.birt.integration.wtp.feature and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2008-12-01 10:51:20 -0500 (Mon, 01 Dec 2008)
New Revision: 12173
Modified:
trunk/birt/features/org.jboss.tools.birt.feature/feature.xml
trunk/birt/features/org.jboss.tools.birt.integration.wtp.feature/feature.xml
Log:
[JBIDE-3239] fix includes/requires for both features
Modified: trunk/birt/features/org.jboss.tools.birt.feature/feature.xml
===================================================================
--- trunk/birt/features/org.jboss.tools.birt.feature/feature.xml 2008-12-01 15:45:50 UTC (rev 12172)
+++ trunk/birt/features/org.jboss.tools.birt.feature/feature.xml 2008-12-01 15:51:20 UTC (rev 12173)
@@ -25,9 +25,11 @@
<requires>
<import feature="org.eclipse.birt" version="2.3.1"/>
- <import feature="org.jboss.tools.birt.integration.wtp.feature"/>
+ <import feature="org.eclipse.birt.integration.wtp" version="2.3.1"/>
</requires>
+ <includes id="org.jboss.tools.birt.integration.wtp.feature" version="0.0.0"/>
+
<plugin
id="org.jboss.tools.birt.oda"
download-size="0"
Modified: trunk/birt/features/org.jboss.tools.birt.integration.wtp.feature/feature.xml
===================================================================
--- trunk/birt/features/org.jboss.tools.birt.integration.wtp.feature/feature.xml 2008-12-01 15:45:50 UTC (rev 12172)
+++ trunk/birt/features/org.jboss.tools.birt.integration.wtp.feature/feature.xml 2008-12-01 15:51:20 UTC (rev 12173)
@@ -22,6 +22,11 @@
<discovery label="%birtUpdateSiteName" url="http://download.eclipse.org/birt/update-site/2.3"/>
</url>
+ <requires>
+ <import feature="org.eclipse.birt" version="2.3.1"/>
+ <import feature="org.eclipse.birt.integration.wtp" version="2.3.1"/>
+ </requires>
+
<plugin
id="org.eclipse.birt.integration.wtp.ui"
download-size="0"
15 years, 5 months
JBoss Tools SVN: r12172 - in trunk/documentation/qa/docs: Test_Cases and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: aklimkovich
Date: 2008-12-01 10:45:50 -0500 (Mon, 01 Dec 2008)
New Revision: 12172
Added:
trunk/documentation/qa/docs/Test_Cases/
trunk/documentation/qa/docs/Test_Cases/CAverification.doc
trunk/documentation/qa/docs/Test_Cases/Compatibility.doc
trunk/documentation/qa/docs/Test_Cases/ComponentSeamTestcases.doc
trunk/documentation/qa/docs/Test_Cases/CreateAndRunProjects.doc
trunk/documentation/qa/docs/Test_Cases/DynWebProject.doc
trunk/documentation/qa/docs/Test_Cases/ESBtests.doc
trunk/documentation/qa/docs/Test_Cases/FileManagment.doc
trunk/documentation/qa/docs/Test_Cases/Hibernate.doc
trunk/documentation/qa/docs/Test_Cases/ImportJSF.doc
trunk/documentation/qa/docs/Test_Cases/ImportStruts.doc
trunk/documentation/qa/docs/Test_Cases/Installer.doc
trunk/documentation/qa/docs/Test_Cases/JSFOpenOn.doc
trunk/documentation/qa/docs/Test_Cases/JSFfacesconfigEdit.doc
trunk/documentation/qa/docs/Test_Cases/JSFwebEdit.doc
trunk/documentation/qa/docs/Test_Cases/JSPOpenOn.doc
trunk/documentation/qa/docs/Test_Cases/ProjectArchives.doc
trunk/documentation/qa/docs/Test_Cases/ServerUsage.doc
trunk/documentation/qa/docs/Test_Cases/SmokeTests.doc
trunk/documentation/qa/docs/Test_Cases/StrutsConfigEdit.doc
trunk/documentation/qa/docs/Test_Cases/StrutsOpenOn.doc
trunk/documentation/qa/docs/Test_Cases/StrutsWebEdit.doc
trunk/documentation/qa/docs/Test_Cases/VPEtests.doc
trunk/documentation/qa/docs/Test_Cases/XmlFilesOpenOn.doc
Log:
Added a folder remotely
Added: trunk/documentation/qa/docs/Test_Cases/CAverification.doc
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/qa/docs/Test_Cases/CAverification.doc
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/qa/docs/Test_Cases/Compatibility.doc
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/qa/docs/Test_Cases/Compatibility.doc
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/qa/docs/Test_Cases/ComponentSeamTestcases.doc
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/qa/docs/Test_Cases/ComponentSeamTestcases.doc
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/qa/docs/Test_Cases/CreateAndRunProjects.doc
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/qa/docs/Test_Cases/CreateAndRunProjects.doc
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/qa/docs/Test_Cases/DynWebProject.doc
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/qa/docs/Test_Cases/DynWebProject.doc
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/qa/docs/Test_Cases/ESBtests.doc
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/qa/docs/Test_Cases/ESBtests.doc
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/qa/docs/Test_Cases/FileManagment.doc
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/qa/docs/Test_Cases/FileManagment.doc
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/qa/docs/Test_Cases/Hibernate.doc
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/qa/docs/Test_Cases/Hibernate.doc
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/qa/docs/Test_Cases/ImportJSF.doc
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/qa/docs/Test_Cases/ImportJSF.doc
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/qa/docs/Test_Cases/ImportStruts.doc
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/qa/docs/Test_Cases/ImportStruts.doc
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/qa/docs/Test_Cases/Installer.doc
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/qa/docs/Test_Cases/Installer.doc
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/qa/docs/Test_Cases/JSFOpenOn.doc
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/qa/docs/Test_Cases/JSFOpenOn.doc
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/qa/docs/Test_Cases/JSFfacesconfigEdit.doc
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/qa/docs/Test_Cases/JSFfacesconfigEdit.doc
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/qa/docs/Test_Cases/JSFwebEdit.doc
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/qa/docs/Test_Cases/JSFwebEdit.doc
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/qa/docs/Test_Cases/JSPOpenOn.doc
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/qa/docs/Test_Cases/JSPOpenOn.doc
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/qa/docs/Test_Cases/ProjectArchives.doc
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/qa/docs/Test_Cases/ProjectArchives.doc
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/qa/docs/Test_Cases/ServerUsage.doc
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/qa/docs/Test_Cases/ServerUsage.doc
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/qa/docs/Test_Cases/SmokeTests.doc
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/qa/docs/Test_Cases/SmokeTests.doc
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/qa/docs/Test_Cases/StrutsConfigEdit.doc
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/qa/docs/Test_Cases/StrutsConfigEdit.doc
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/qa/docs/Test_Cases/StrutsOpenOn.doc
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/qa/docs/Test_Cases/StrutsOpenOn.doc
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/qa/docs/Test_Cases/StrutsWebEdit.doc
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/qa/docs/Test_Cases/StrutsWebEdit.doc
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/qa/docs/Test_Cases/VPEtests.doc
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/qa/docs/Test_Cases/VPEtests.doc
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/qa/docs/Test_Cases/XmlFilesOpenOn.doc
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/qa/docs/Test_Cases/XmlFilesOpenOn.doc
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years, 5 months