Author: snjeza
Date: 2012-02-04 19:36:54 -0500 (Sat, 04 Feb 2012)
New Revision: 38433
Modified:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/dialogs/ProjectExamplesDialog.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/FeedsToolTip.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/JBossCentralEditor.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/jobs/RefreshTutorialsJob.java
Log:
JBIDE-10658 find place where description for category should live
Modified:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java
===================================================================
---
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java 2012-02-05
00:36:38 UTC (rev 38432)
+++
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java 2012-02-05
00:36:54 UTC (rev 38433)
@@ -57,8 +57,8 @@
import org.jboss.tools.central.configurators.IJBossCentralConfigurator;
import org.jboss.tools.central.editors.JBossCentralEditor;
import org.jboss.tools.central.editors.JBossCentralEditorInput;
-import org.jboss.tools.project.examples.model.Category;
-import org.jboss.tools.project.examples.model.Project;
+import org.jboss.tools.project.examples.model.ProjectExampleCategory;
+import org.jboss.tools.project.examples.model.ProjectExample;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
@@ -132,7 +132,7 @@
private BundleContext bundleContext;
- private Map<Category, List<Project>> tutorialCategories;
+ private Map<ProjectExampleCategory, List<ProjectExample>>
tutorialCategories;
public static final int MAX_FEEDS = 100;
@@ -413,7 +413,7 @@
return image;
}
- public String getDescription(Project project) {
+ public String getDescription(ProjectExample project) {
StringBuilder buffer = new StringBuilder();
if (project.getDescription() != null) {
buffer.append(project.getDescription());
Modified:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/dialogs/ProjectExamplesDialog.java
===================================================================
---
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/dialogs/ProjectExamplesDialog.java 2012-02-05
00:36:38 UTC (rev 38432)
+++
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/dialogs/ProjectExamplesDialog.java 2012-02-05
00:36:54 UTC (rev 38433)
@@ -64,7 +64,7 @@
import org.jboss.tools.central.actions.JBossRuntimeDetectionPreferencesHandler;
import org.jboss.tools.central.editors.DescriptionToolTip;
import org.jboss.tools.project.examples.ProjectExamplesActivator;
-import org.jboss.tools.project.examples.model.Project;
+import org.jboss.tools.project.examples.model.ProjectExample;
import org.jboss.tools.project.examples.model.ProjectFix;
import org.jboss.tools.runtime.core.RuntimeCoreActivator;
import org.jboss.tools.runtime.core.model.DownloadRuntime;
@@ -76,7 +76,7 @@
*/
public class ProjectExamplesDialog extends FormDialog implements IRunnableContext {
- private Project tutorial;
+ private ProjectExample tutorial;
private FormToolkit toolkit;
private ScrolledForm form;
private Composite fixesComposite;
@@ -85,7 +85,7 @@
private Control fLastControl;
private Set<Button> controls = new HashSet<Button>();
- public ProjectExamplesDialog(Shell parentShell, Project project) {
+ public ProjectExamplesDialog(Shell parentShell, ProjectExample project) {
super(parentShell);
setShellStyle(SWT.CLOSE | SWT.MAX | SWT.TITLE | SWT.BORDER
| SWT.RESIZE | getDefaultOrientation());
Modified:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/FeedsToolTip.java
===================================================================
---
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/FeedsToolTip.java 2012-02-05
00:36:38 UTC (rev 38432)
+++
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/FeedsToolTip.java 2012-02-05
00:36:54 UTC (rev 38433)
@@ -63,15 +63,14 @@
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
parent.setLayoutData(gd);
- Browser browser1;
+ final Browser[] browser = new Browser[1];
try {
- browser1 = new Browser(parent, SWT.NONE);
+ browser[0] = new Browser(parent, SWT.NONE);
} catch (Exception e1) {
- browser1 = new Browser(parent, SWT.WEBKIT);
+ browser[0] = new Browser(parent, SWT.WEBKIT);
}
- final Browser browser = browser1;
- browser.setJavascriptEnabled(false);
- browser.addLocationListener(new LocationAdapter() {
+ browser[0].setJavascriptEnabled(false);
+ browser[0].addLocationListener(new LocationAdapter() {
@Override
public void changed(LocationEvent event) {
@@ -82,17 +81,17 @@
}
}
});
- browser.addOpenWindowListener(new OpenWindowListener() {
+ browser[0].addOpenWindowListener(new OpenWindowListener() {
public void open(WindowEvent event) {
event.required= true;
- event.browser = browser;
+ event.browser = browser[0];
}
});
gd = new GridData(SWT.FILL, SWT.FILL, true, true);
gd.heightHint = 150;
gd.widthHint = 400;
- browser.setLayoutData(gd);
- browser.setText(toolText);
+ browser[0].setLayoutData(gd);
+ browser[0].setText(toolText);
return parent;
}
Modified:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java
===================================================================
---
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java 2012-02-05
00:36:38 UTC (rev 38432)
+++
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java 2012-02-05
00:36:54 UTC (rev 38433)
@@ -99,8 +99,8 @@
import org.jboss.tools.central.jobs.RefreshNewsJob;
import org.jboss.tools.central.jobs.RefreshTutorialsJob;
import org.jboss.tools.central.model.FeedsEntry;
-import org.jboss.tools.project.examples.model.Category;
-import org.jboss.tools.project.examples.model.Project;
+import org.jboss.tools.project.examples.model.ProjectExampleCategory;
+import org.jboss.tools.project.examples.model.ProjectExample;
import org.osgi.framework.Bundle;
/**
@@ -141,7 +141,7 @@
private Composite projectsComposite;
private Composite documentationComposite;
- private Set<Category> expandedCategories = new HashSet<Category>();
+ private Set<ProjectExampleCategory> expandedCategories = new
HashSet<ProjectExampleCategory>();
private Section newsSection;
private ScrolledComposite newsScrollComposite;
private PageBook newsPageBook;
@@ -652,8 +652,8 @@
}
}
- private void displayTutorialLinks(final Collection<Project> tutorials, final
Composite composite, boolean addTooltips) {
- for (final Project tutorial : tutorials) {
+ private void displayTutorialLinks(final Collection<ProjectExample> tutorials,
final Composite composite, boolean addTooltips) {
+ for (final ProjectExample tutorial : tutorials) {
FormText tutorialText = toolkit.createFormText(composite, true);
configureTutorialText(tutorialText, tutorial);
if (addTooltips) {
@@ -870,7 +870,7 @@
showException(tutorialPageBook, tutorialsExceptionText, job.getException());
return;
}
- Map<Category, List<Project>> categories = job.getTutorialCategories();
+ Map<ProjectExampleCategory, List<ProjectExample>> categories =
job.getTutorialCategories();
if (categories == null || categories.size() == 0) {
showNote(tutorialPageBook, tutorialsNoteText, tutorialScrollComposite);
return;
@@ -880,7 +880,7 @@
@Deprecated
//This method should be removed once the EE6 archetypes are wizardified
- private void updateNewProjects(List<Project> wizardProjects) {
+ private void updateNewProjects(List<ProjectExample> wizardProjects) {
if (!newProjectsInitialized) {
if (wizardProjects != null) {
newProjectsInitialized = true;
@@ -890,11 +890,11 @@
}
}
- private void showTutorials(Map<Category, List<Project>> categories) {
+ private void showTutorials(Map<ProjectExampleCategory, List<ProjectExample>>
categories) {
disposeChildren(tutorialsComposite);
- List<Category> sortedCategories = new
ArrayList<Category>(categories.keySet());
+ List<ProjectExampleCategory> sortedCategories = new
ArrayList<ProjectExampleCategory>(categories.keySet());
Collections.sort(sortedCategories);
- for (final Category category : sortedCategories) {
+ for (final ProjectExampleCategory category : sortedCategories) {
int style = ExpandableComposite.TITLE_BAR|ExpandableComposite.TWISTIE;
if (expandedCategories.contains(category)) {
style|=ExpandableComposite.EXPANDED;
@@ -956,7 +956,7 @@
return categoryFont;
}
- private void hookTooltip(FormText tutorialText, Project tutorial) {
+ private void hookTooltip(FormText tutorialText, ProjectExample tutorial) {
final String description =
JBossCentralActivator.getDefault().getDescription(tutorial);
if (description != null && !description.isEmpty()) {
ToolTip toolTip = new DescriptionToolTip(tutorialText, description);
@@ -964,7 +964,7 @@
}
}
- protected void configureTutorialText(FormText tutorialText, final Project tutorial) {
+ protected void configureTutorialText(FormText tutorialText, final ProjectExample
tutorial) {
StringBuilder buffer = new StringBuilder();
buffer.append(JBossCentralActivator.FORM_START_TAG);
buffer.append("<img href=\"image\"/> ");
@@ -1160,16 +1160,15 @@
Point computedSize = tutorialPageBook.computeSize(SWT.DEFAULT, SWT.DEFAULT);
int y = computedSize.y;
- if (y > 200) {
- y = 200;
+ if (y > 100) {
+ y = 100;
}
tutorialScrollComposite.setMinSize(widthHint, y);
- //newsPageBook.layout(true, true);
- //blogsPageBook.layout(true, true);
+
recomputeScrollComposite(blogsScrollComposite, blogsPageBook);
recomputeScrollComposite(newsScrollComposite, newsPageBook);
- //form.redraw();
+
form.layout(true, true);
form.reflow(true);
@@ -1258,7 +1257,7 @@
//TEMPORARY HACK FOR JBIDE-10053 (Java EE6 archetypes in the project section)
//Should be removed once these archetype tutorials are changed to use wizards as per
JBIDE-10264
RefreshTutorialsJob job = RefreshTutorialsJob.INSTANCE;
- List<Project> wizardProjects = job.getWizardProjects();
+ List<ProjectExample> wizardProjects = job.getWizardProjects();
if (wizardProjects != null){
updateNewProjects(wizardProjects);
}
Modified:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/JBossCentralEditor.java
===================================================================
---
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/JBossCentralEditor.java 2012-02-05
00:36:38 UTC (rev 38432)
+++
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/JBossCentralEditor.java 2012-02-05
00:36:54 UTC (rev 38433)
@@ -162,21 +162,9 @@
ScrolledForm form = headerForm.getForm();
form.setText(JBOSS_CENTRAL);
form.setToolTipText(JBOSS_CENTRAL);
-
form.setImage(getHeaderImage());
getToolkit().decorateFormHeading(form.getForm());
- // Composite headerComposite =
- // getToolkit().createComposite(form.getForm().getHead(), SWT.NONE);
- // headerComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true,
- // false));
- // headerComposite.setLayout(new GridLayout(2, false));
- // headerComposite.setBackground(null);
- //
- // createSearchControl(headerComposite);
-
- // form.getForm().setHeadClient(headerComposite);
-
IToolBarManager toolbar = form.getToolBarManager();
ControlContribution searchControl = new ControlContribution("Search") {
@Override
Modified:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/jobs/RefreshTutorialsJob.java
===================================================================
---
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/jobs/RefreshTutorialsJob.java 2012-02-05
00:36:38 UTC (rev 38432)
+++
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/jobs/RefreshTutorialsJob.java 2012-02-05
00:36:54 UTC (rev 38433)
@@ -21,10 +21,10 @@
import org.eclipse.core.runtime.jobs.Job;
import org.jboss.tools.central.JBossCentralActivator;
import org.jboss.tools.project.examples.ProjectExamplesActivator;
-import org.jboss.tools.project.examples.model.Category;
-import org.jboss.tools.project.examples.model.Project;
+import org.jboss.tools.project.examples.model.ProjectExampleCategory;
+import org.jboss.tools.project.examples.model.ProjectExample;
import org.jboss.tools.project.examples.model.ProjectFix;
-import org.jboss.tools.project.examples.model.ProjectUtil;
+import org.jboss.tools.project.examples.model.ProjectExampleUtil;
/**
*
@@ -34,9 +34,9 @@
public class RefreshTutorialsJob extends Job {
private Exception exception;
- private Map<Category,List<Project>> tutorialCategories;
+ private Map<ProjectExampleCategory,List<ProjectExample>>
tutorialCategories;
- private List<Project> wizardProjects;
+ private List<ProjectExample> wizardProjects;
public static RefreshTutorialsJob INSTANCE = new RefreshTutorialsJob();
@@ -50,16 +50,16 @@
if (monitor.isCanceled()) {
return Status.CANCEL_STATUS;
}
- List<Category> categories = ProjectUtil.getProjects(monitor);
- wizardProjects = ProjectUtil.getProjectsByTags(categories, "wizard");
- List<Project> tutorials = ProjectUtil.getProjectsByTags(categories,
"central");
+ List<ProjectExampleCategory> categories =
ProjectExampleUtil.getProjects(monitor);
+ wizardProjects = ProjectExampleUtil.getProjectsByTags(categories, "wizard");
+ List<ProjectExample> tutorials = ProjectExampleUtil.getProjectsByTags(categories,
"central");
if (tutorialCategories == null) {
- tutorialCategories = new HashMap<Category, List<Project>>();
+ tutorialCategories = new HashMap<ProjectExampleCategory,
List<ProjectExample>>();
} else {
tutorialCategories.clear();
}
- for (Project project : tutorials) {
+ for (ProjectExample project : tutorials) {
if (canBeImported(project)){
List<ProjectFix> unsatisfiedFixes = new ArrayList<ProjectFix>();
List<ProjectFix> fixes = project.getFixes();
@@ -69,10 +69,10 @@
unsatisfiedFixes.add(fix);
}
}
- Category category = project.getCategory();
- List<Project> projects = tutorialCategories.get(category);
+ ProjectExampleCategory category = project.getCategory();
+ List<ProjectExample> projects = tutorialCategories.get(category);
if (projects == null) {
- projects = new ArrayList<Project>();
+ projects = new ArrayList<ProjectExample>();
tutorialCategories.put(category, projects);
}
projects.add(project);
@@ -82,7 +82,7 @@
return Status.OK_STATUS;
}
- private boolean canBeImported(Project project) {
+ private boolean canBeImported(ProjectExample project) {
return ProjectExamplesActivator.getDefault()
.getImportProjectExample(project.getImportType()) != null;
}
@@ -95,11 +95,11 @@
this.exception = exception;
}
- public Map<Category,List<Project>> getTutorialCategories() {
+ public Map<ProjectExampleCategory,List<ProjectExample>>
getTutorialCategories() {
return tutorialCategories;
}
- public List<Project> getWizardProjects() {
+ public List<ProjectExample> getWizardProjects() {
return wizardProjects;
}